• I use a child theme to disable the display of the page title, using

    .entry-title{display: none;}

    as I would rather use my own H1 text.
    However, I then find that I have two h1 tags defined in the html, which on-page optimisers object to.
    How can I get rid of the

    <h1 id=”site-title”>

    ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • How can I get rid of the <h1 id="site-title">

    edit header.php;

    change this line:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>

    to:

    <?php $heading_tag = 'div'; ?>

    Thread Starter BeeJayEff

    (@beejayeff)

    Thanks – that got rid of it from the first page. Do I have to do something with the next line to get rid of it on other pages ?

    please define exactly which h1 you want to get rid of – it sounded as if you were targeting h1#site-title only.

    can you post a link to your site?

    have you searched through the limited number of template files?

    Thread Starter BeeJayEff

    (@beejayeff)

    Sorry, I hadn’t looked closely enough. Only the first page had site-title, all others have

    <h1 class=”entry-title”>pagename </h1>

    – that’s what I’d now like to get rid of.
    Site is blacklandsalpacas.co.uk.

    look in loop.php, loop-single.php and loop-page.php

    Thread Starter BeeJayEff

    (@beejayeff)

    Thanks for the pointer. I realised this was only happening on Pages (not Posts) so in the section

    <?php if ( is_front_page() ) { ?>
    <h2 class=”entry-title”><?php the_title(); ?></h2>
    <?php } else { ?>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    <?php } ?>

    in loop-page.php, I deleted the

    <?php } else { ?>
    <h1 class=”entry-title”><?php the_title(); ?></h1>

    – and it seems to have worked. Is that correct, or might I have damaged something else ?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Twentyten theme, multiple h1 tags’ is closed to new replies.