最新帖子在博客页面上显示为页面主标题

时间:2014-08-14 作者:Waymond

我的最新博客帖子将显示为我博客页面的标题。我将主页的页面设置为静态,并将模板的所有标题显示在顶部,博客帖子除外。我尝试使用条件标记“is\\u home”,但不断出错。感谢您的帮助!这是我在头版底部的代码。php

<?php if (is_front_page()) { ?>
<section class="m-main-hero"></section>
 <section class="m-hero-caption col-lg-8 col-md-8 col-md-offset-2 col-lg-offset-2">
  <p>Teaching kids how to eat and enjoy healthy foods through cooking cooking and experimental learning</p>
  <h2 class="subtitle fancy"><span>Since 1995</span></h2>
   </div> <!-- End of container -->
</section> <!-- end of column header -->

 <section class="m-front-img">
        <?php the_field(\'for_educators_image\') ?>
        <figure class="m-for-families">
        </figure>
    </section>

  <?php } else if() { ?>
  <section class="m-main-hero-single"></section>
  <section class="m-single-page-header">
    <h1><?php echo get_the_title(); ?></h1>
  </section>
  <?php } ?>

1 个回复
SO网友:Waymond

我最终使用了

      <?php } else if(is_home()) { ?>
  <section class="m-main-hero-single"></section>
  <section class="m-single-page-header">
    <h1>Blog</h1>
  </section>
它成功了。

结束

相关推荐