TwentyEleven Theme and H1 tags

Discussion in 'WordPress Themes' started by wannalearn, Dec 24, 2011.

  1. wannalearn New Member

    Hi Kevin,

    This is my question about the way wordpress themes configure Heading tags out of the box. I'll make it specific to the TwentyEleven Theme, but I've had similar problems with other themes too.

    What's the problem?
    • The TwentyEleven theme seems automatically to put the blog title in an H1 tag on every single page
    • This theme also seems to put post/page titles in H1 tags on every single page
    • The result is TWO H1 tags per page, which obviously isn't good at all
    How to fix it?
    I had a similar problem with my last wordpress blog (different theme). That theme put blog title in H1 on every single page, and post titles in H2 on every single page.
    I had to pay someone with coding/programming/"php" knowledge to edit my theme. He did and I got the configuration I wanted (and that SEOs say is best):
    • Blog title in H1 tag on homepage and ONLY on homepage
    • Post/page title in H1 tag on all other pages
    • Blog title in some sort of "div" tag or "p" tag or H3 (don't really know what)
    • Only ONE H1 tag per page
    My issue now is this:
    I don't want to have to pay someone to fix the template every single time I set up a new wordpress blog. Surely there must be a more efficient, automated way to fix the issue (or avoid it in the first place).
    I'm a technophobe and am terrified about tampering with "php" code (I've seen posts that give you lots of code you need to copy and paste but when I did it I messed up the formatting of the blog title and tagline completely!)
    So I guess my questions are:
    (i) Is there a theme that gets the H1/blog title/post title configuration right out of the box? (so I don't immediately have something to "fix" each time I set up a WP blog?)
    (ii) If not, what would you suggest as the best solution for this issue?
    Thank you so much for your help! Hopefully this will help other WP users as well!
    Best Wishes and Merry Christmas to all,
    Adam
  2. Kevin Muldoon WordPress Fanatic!

    You shouldn't have to pay someone to get something like this fixed as it's just a simple edit.

    What you need to do is find the your title code and place an if statement so that h1 is used for the logo/site-title on the home page and an h2 on all other pages.

    For example, here is the code I currently use on WPMods for this.

    PHP:
    <?php       
     
    if ( is_home()  ) {
     
    ?>
        <h1><a href="<?php echo get_option('home'); ?>" title="WordPress Mods">WordPress Mods</a></h1>
    <?php
    } else {
    ?>
      <h2><a href="<?php echo get_option('home'); ?>"></a></h2>
    <?php
    }
    ?>
    I have also ensured that the post title is set as an H1 tag in my page.php and single.php templates.

    What you need to ensure is that the font of your logo H2 tag matches that of your H1 tag so you need to adjust stylesheet accordingly.

    Some designs have all of this set up already, some don't. You would need to ask the developer before purchasing the theme what way they have set it up...though I wouldn't let a simple thing like this stop you from buying a design you like.

    Does all of this make sense? Also, is it just the Twenty Eleven theme you need this done to just now. If so, I can walk you through exactly what you need to do :)
  3. wannalearn New Member

    Hi Kevin,

    Thank you so much for such a quick and helpful response. Yes, I'd like to avoid paying someone to do this (as I had to do last time) because I intend to set up more blogs in future and it would be a pain to have to ask someone to fix this every single time!

    Yes, right now I'm using just Twenty Eleven Theme so I'd love a step-by-step guide. I tried to follow the instructions in this article: http://www.rlmseo.com/blog/wordpress-seo-heading-tags/

    It "sort of" gives you a step-by-step guide for fixing a similar issue. (Though when I followed it for my last blog I messed up the formatting of the blog title, which got put into very strange sizes and positions!)

    However, the thing about the Twenty Eleven Theme (as far as I can see) is that it already puts post title/page title in H1 tags on all pages.

    What I need to do to the theme is (I think) this:
    (i) Stop it from putting blog title in H1 tags on all pages apart from homepage
    (right now it puts blog title in H1 on every page and therefore generates TWO H1 tags on every page - one around post title and one around blog title)
    (ii) Keep letting it post/page title in H1 tags on all pages apart from homepage
    (iii) Make it put post titles in H2 on homepage
    (iv) Make it put blog title in H2 or H3 or <p>/<div> (some people say) on all pages apart from homepage
    [I think I'd ideally have it in H3 or this <p> tag thing as my blog title isn't really that relevant on my post pages]
    (v) Let it put blog title in H1 on homepage
    (vi) Edit CSS stylesheets (I think?!) to make sure blog title looks the same on all pages whether it's in H1, H2, H3, <p> or whatever else.

    Would it be possible for you to show me how to do all this? I'd certainly be willing to invest in learning this once and for all as it seems like it's going to be an issue every time I set up a new WP blog!

    Thanks again for your fantastic help. Have a great Christmas!

    Best Wishes

    Adam
  4. Kevin Muldoon WordPress Fanatic!

    Hi Adam,

    Due to taking a few days off for Christmas, I've got a lot of work to catch up on. It sounds like you need a detailed explanation about this so what I suggest is that I tackle this on the main blog for you and do a complete walk through of it. You will need to wait towards the end of the week for it though. Hope that isn't a major problem.

    Kevin
  5. wannalearn New Member

    Hi Kevin,

    Thanks for your message. Of course, it's Christmas. I totally understand even if you don't have time for this at all. Anything is a bonus, which I really appreciate.

    Perhaps I can make it simpler/condense the issue so as to make it easier for you to address when you have the time.

    Twenty Eleven Theme's default set-up (on my blog at least!)

    Homepage
    • Blog title in <H1>
    • Post titles also in <H1>
    All other pages (including single post pages)
    • Blog title in <H1>
    • Post/page title also in <H1>
    Set-up I would prefer

    Homepage
    • Blog title in <H1>
    • Post titles in <H2>
    All other pages (including single post pages)
    • Blog title in <H3> [blog title is really not important on these pages!]
    • Post/page title in <H1>
    When I tried to do this myself on a previous blog I messed up the formatting of the blog title, because I didn't know how to edit the CSS. Apparently you need to edit the CSS so that the blog title looks the sameno matter whether it's in <H1> or <H3> - i.e. so that it's consistent across all pages.
    Anyway, I hope this helps you to help others. Thanks again for all the help. I'll certainly be coming back to wpmods.com regardless!
    Hope you had a nice Christmas and have a happy new year!
    Adam
  6. Kevin Muldoon WordPress Fanatic!

    I am going to write an article about this today and publish it on Thursday.

    You need to realise though that according to the official W3C standards, you should only have one H1 tag per page.

    You should make your blog title in h2 on your sub pages, not h3. You will need to modify your style.css so that your title header text is the same size for h1 and h2 tags.
  7. wannalearn New Member

    Hi Kevin,

    Thanks for your response.

    Yes, I understand that it's best to have just one H1 tag per page. That's one of the reasons why I was so surprised to find that the Twenty Eleven Theme automatically generates TWO of them per page! It seems an odd thing for wordpress to do.

    It seems other people are bothered by this as well: http://wordpress.org/support/topic/change-duplicate-h1-tags-for-single-pages-twenty-eleven-theme

    Thanks for confirming that you need to edit CSS to make blog title same size regardless of whether it's H1, H2 or whatever. This is something else I feel terrified about doing!

    I look forward to your blog post. Thanks again. Hope you had a nice Christmas Kevin,

    best Wishes

    Adam
  8. Kevin Muldoon WordPress Fanatic!

    Hope you had a good Christmas too Adam :)

    Yeah I'm surprised that Twenty Eleven has two H1 tags. Matt Mullenweg is taking control of the Twenty Twelve theme so hopefully that addresses a lot of problems that Twenty Eleven had (which let's face it, was disappointing compared to Twenty Ten).
  9. Kevin Muldoon WordPress Fanatic!

  10. wannalearn New Member

    Hi Kevin,

    Thanks so much for posting your article. I'm sure it will help not just me but tons of other WP-users as well. Have a great new year,

    Best Wishes

    Adam
    Kevin Muldoon likes this.
  11. Kevin Muldoon WordPress Fanatic!

    No problem. Glad you found it useful :)

Share This Page

Users found this page by searching for:

  1. change h1 twenty eleven

    ,
  2. twenty eleven h1

    ,
  3. how do i change the page names in twenty eleven?

    ,
  4. should blog post titles be h1,
  5. tag pages in twenty eleven,
  6. wordpress themes similar to twenty eleven,
  7. two h1 tags on wordpress,
  8. twenty eleven blog edit post title,
  9. 2 h1 tags category archives twenty eleven,
  10. twentyeleven h1