2017-05-04 38 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

相关问题