0

My latest blog post is showing up as the title of my blog page. I have my page set to static for the home page and have all the titles of the templates displaying at the top except the blog post. I tried to use the conditional tag "is_home" but I kept getting errors. Any help is appreciated! Here is my code at the bottom of the front-page.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 } ?>
0

I ended up using

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

and it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.