关于wordpress的首页问题,求解答

问题有点长,但是真心希望有大神能给解答一下,本菜先在这里谢过了!
首先,我在主题的根目录下复制了index.php,并重命名为page.php。然后将其设置为名叫home的模板。随后,我在wordpress面板中新建了一个首页页面,使用的是刚刚的home模板,图片描述并将其添加到导航栏中图片描述

此时页面显示的是index.php的内容,可是当我点击首页按钮时,页面变成了这样!图片描述
为什么会这样呢,首页的效果不是应该和index一样吗?怎么才能让点击首页出现的界面和index一样呢?

再附上index.php的代码。。

<?php get_header(); ?>
 <!--mainbody-->
 <div class="container">
   <div class="row">
     <div class="col-md-8">
     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <article class="articles">    
           <header>
               <a href="#" class="cat">散文<i></i></a>
               <a href="<?php the_permalink(); ?>" class="gotoArchive"><?php the_title(); ?></a>
           </header>
               <p class="content"><?php echo mb_strimwidth(get_the_content(), 0, 600,'...'); ?></p>         
        <footer>
        <a href="#">#test</a>
        <a href="#">#articels</a>
        <a href="#">#something</a>
        <span><a href="<?php the_permalink(); ?>" class="content">继续阅读>></a></span>
       </footer>          
     </article>
    <?php endwhile; else:?>
      <p><?php _e('the page could not found'); ?></p>
    <?php endif; ?>
    <?php if(function_exists('wp_bs_pagination')){
      wp_bs_pagination();
      } ?>
     </div><!--col-md-8-->
   </div><!--row-->
 </div><!--container-->
 <?php get_footer(); ?>
阅读 2.2k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进