2017-05-04 37 views
1

我在我的WordPress站點中遇到了一個問題。當我從網站註銷時,主頁的內容很少消失。像一些標題和插件等,用戶從wordpress站點註銷後不顯示所有頁面內容

這裏是我的代碼「關於」部分:

<?php 
/** 
* The template for displaying about section in front page. 
* 
* @package WordPress 
* @subpackage illdy 
*/ 
?> 
<?php 
if (current_user_can('edit_theme_options')) { 
    $general_title = get_theme_mod('illdy_about_general_title', __('About', 'illdy')); 
    $general_entry = get_theme_mod('illdy_about_general_entry', __('It is an amazng one-page theme with great features that offers an incredible experience. It is easy to install, make changes, adapt for your business. A modern design with clean lines and styling for a wide variety of content, exactly how a business design should be. You can add as many images as you want to the main header area and turn them into slider.', 'illdy')); 
}else{ 
    $general_title = get_theme_mod('illdy_about_general_title'); 
    $general_entry = get_theme_mod('illdy_about_general_entry'); 
} 
?> 

<?php if ($general_title != '' || $general_entry != '' || is_active_sidebar('front-page-about-sidebar')) { ?> 

<section id="about" class="front-page-section" style="<?php if(!$general_title && !$general_entry): echo 'padding-top: 130px;'; endif; ?>"> 
    <?php if($general_title || $general_entry): ?> 
     <div class="section-header"> 
      <div class="container"> 
       <div class="row"> 
        <?php if($general_title): ?> 
         <div class="col-sm-12"> 
          <h3><?php echo do_shortcode(wp_kses_post($general_title)); ?></h3> 
         </div><!--/.col-sm-12--> 
        <?php endif; ?> 
        <?php if($general_entry): ?> 
         <div class="col-sm-10 col-sm-offset-1"> 
          <div class="section-description"><?php echo do_shortcode(wp_kses_post($general_entry)); ?></div> 
         </div><!--/.col-sm-10.col-sm-offset-1--> 
        <?php endif; ?> 
       </div><!--/.row--> 
      </div><!--/.container--> 
     </div><!--/.section-header--> 
    <?php endif; ?> 
    <?php /*?><div class="section-content"> 
     <div class="container"> 
      <div class="row"> 
       <?php 
       if(is_active_sidebar('front-page-about-sidebar')): 
        dynamic_sidebar('front-page-about-sidebar'); 
       elseif(current_user_can('edit_theme_options') & defined("ILLDY_COMPANION")): 
        $the_widget_args = array(
         'before_widget' => '<div class="col-sm-4 col-sm-offset-0 col-xs-10 col-xs-offset-1 col-lg-4 col-lg-offset-0 widget_illdy_skill">', 
         'after_widget' => '</div>', 
         'before_title' => '', 
         'after_title' => '' 
        ); 

        the_widget('Illdy_Widget_Skill', 'title='. __('Testing', 'illdy') .'&percentage=60&icon=fa-font&color=#f18b6d', $the_widget_args); 
        the_widget('Illdy_Widget_Skill', 'title='. __('Design', 'illdy') .'&percentage=82&icon=fa-pencil&color=#f1d204', $the_widget_args); 
        the_widget('Illdy_Widget_Skill', 'title='. __('Development', 'illdy') .'&percentage=86&icon=fa-code&color=#6a4d8a', $the_widget_args); 
       endif; 
       ?> 
      </div><!--/.row--> 
     </div><!--/.container--> 
    </div><!--/.section-content--><?php */?> 
</section><!--/#about.front-page-section--> 

<?php } ?> 
+0

是否像只有登錄用戶可以看到的東西?代碼是這樣寫的? – Exprator

+0

沒有這樣的邏輯 –

+0

然後發佈主頁的代碼 – Exprator

回答

1

目前你的代碼是

<?php 
if (current_user_can('edit_theme_options')) { 
    $general_title = get_theme_mod('illdy_about_general_title', __('About', 'illdy')); 
    $general_entry = get_theme_mod('illdy_about_general_entry', __('It is an amazng one-page theme with great features that offers an incredible experience. It is easy to install, make changes, adapt for your business. A modern design with clean lines and styling for a wide variety of content, exactly how a business design should be. You can add as many images as you want to the main header area and turn them into slider.', 'illdy')); 
}else{ 
    $general_title = get_theme_mod('illdy_about_general_title'); 
    $general_entry = get_theme_mod('illdy_about_general_entry'); 
} 
?> 

<?php 

    $general_title = get_theme_mod('illdy_about_general_title', __('About', 'illdy')); 
    $general_entry = get_theme_mod('illdy_about_general_entry', __('It is an amazng one-page theme with great features that offers an incredible experience. It is easy to install, make changes, adapt for your business. A modern design with clean lines and styling for a wide variety of content, exactly how a business design should be. You can add as many images as you want to the main header area and turn them into slider.', 'illdy')); 
?> 
取代那些代碼,請檢查

這意味着刪除if和else部分。

+0

非常感謝。它爲我工作:) –

+0

很高興知道這個解決方案正在工作:)請標記爲答案。 – Ashkar

相關問題