2014-05-15 92 views
0

我已经将Bootstrap 3整合到Wordpress中,但现在我有点困惑。我用文件index.php,header.php,footer.php,functions.php & single.php创建了一个新的主题。我也拉了一个菜单,允许我自定义,我想调用我的functions.php文件中包含的navwalker.php。Wordpress&Bootstrap

一切正常,所以我的帖子显示在索引页面等,但他们也显示在每一个页面 - 我通过WordPress的管理创建的其他页面显示菜单,我可以点击它们,但内容上index.php显示在每个页面上 - 我如何只在主页上显示此内容,而没有其他内容?

以下是我的索引页面中的代码。

<?php get_header(); ?> 
    <div class="jumbotron"> 
     <div class="container"> 
      <center><h1>site name</h1></center> 
      <br /> 
      <center><h4>Lorem ipsum</h4></center> 
     </div> 
    </div> 

    <div class="container" style="background-color: rgba(255,255,255,0.3); padding-top:20px; color: #FFF;"> 
     <div class="page-header" style="border-bottom: none;"> 
      <center><h3>FROM THE BLOG</h3></center> 
     </div> 
    </div> 

    <div class="container" style="background-color: rgba(255,255,255,1.0); padding-top: 1px; border-top: 3px solid #f6c52d; padding-top: 20px; margin-bottom: 20px;"> 
     <div class="row"> 
      <div class="col-md-8"> 
       <div class="panel panel-default" style="border: none;"> 
        <div class="panel-body"> 
         <div class="page-header"> 
          <h3>Latest news</h3> 
         </div>       

         <?php query_posts('posts_per_page=3'); while(have_posts()) : the_post(); ?> 
         <?php the_post_thumbnail('medium'); ?>      
          <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>      
          <p><?php the_excerpt(); ?></p> 
          <p class="text-muted">Posted by <?php the_author(); ?> on <?php the_time('F jS, Y'); ?></p> 
         <?php endwhile; wp_reset_query(); ?> 
        </div>      
       </div> 
      </div> 

      <div class="col-md-4"> 
       <div class="panel panel-default"style="border: none;"> 
        <div class="panel-body"> 
         <div class="page-header"> 
          <h3>Weather info</h3> 
         </div> 

         <a href="findus.html"> 
          <img src="<?php bloginfo('template_url')?>/img/lake.png" style="width: 100%;"/> 
         </a>                 
        </div> 
       </div> 
      </div> 
     </div> 
    </div>     
<?php get_footer(); ?> 

回答

0

好吧我想我已经想通了 - 在我的菜单选项中,我有能力使用URL直接链接到我的自定义页面。我会这样做。

我必须包括一个位PHP的进入页面:

<?php 
/* 
* Template Name: Contact Page 
* Description: A Page Template with a darker design. 
*/ 

// Code to display Page goes here... 

?> 

而且从Wp的Admin屏幕的页面,我不得不分配的下拉该页面模板上为我工作的罚款!