Forums

[resolved] Is post title also your H1 tag? (8 posts)

  1. Louise M
    Member
    Posted 8 months ago #

    Hi there,

    I was taught that a post title in WP is automatically an H1 tag? So no need to put another H1 tag in the content portion of your post.

    Is this true?

    Thanks
    Louise

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    Depends on your theme, but generally yes. If you theme changes that behavior, then no.

  3. Louise M
    Member
    Posted 8 months ago #

    Thank you!

    I will check with the theme.

    Louise

  4. Louise M
    Member
    Posted 8 months ago #

    As said before, I will check with the theme.

    But generally, is there a snippet of code I can check for that indicates whether the theme does this?

    Louise

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 8 months ago #

    <h1 class="something">
    <?php the_title(); ?>
    </h1>

    Something like that

    Some themes will make the home page (index view) have the h1 tag as the site title, then once you go to individual pages or single post view, the post/page title becomes the h1..... that's how I prefer it done

  6. Louise M
    Member
    Posted 8 months ago #

    Thanks, I looked that up. This is what I found:

    <h1 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h1>
    for the page.php

    <h1><?php the_title(); ?></h1>
    for single post page

    Could those be it?

    Louise

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 8 months ago #

    Yes, those are it

  8. Louise M
    Member
    Posted 8 months ago #

    Thanks for the help Rev.Voodoo!

Reply

You must log in to post.

About this Topic