[Support request] homepage using sections adding h1 tag

Home Forums Support [Support request] homepage using sections adding h1 tag

Home Forums Support homepage using sections adding h1 tag

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #616818
    Dave

    Tom,

    I discovered today my homepage had no h1 tag.

    I found this code in the support form.

    <?php if ( is_home() ) : ?>
    <h1 class=”main-title” itemprop=”headline”>Android-Ice Cream-Sandwich</h1>
    <?php else : ?>
    <p class=”main-title” itemprop=”headline”>Android-Ice Cream-Sandwich</p>
    <?php endif; ?>
    <p class=”site-description”>DER Android Blog</p>

    However, my homepage is built using sections. For some reason it my home page isn’t recognized at the homepage even though it is set has homepage in Settings – Reading. I had to change the is_home to is_page (page id) to get the code to work.

    I’m guessing this has something to do with the page being built with sections.

    Thought I’d post this in case anyone else is running into an issue of no h1 tag on their homepage using sections.

    #617458
    Tom
    Lead Developer
    Lead Developer

    Hey Dave,

    Instead of is_home() (which refers to the blog), try using is_front_page().

    You can also just manually add an H1 into your first Section on the page 🙂

    Thanks for sharing!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.