• Resolved sp123

    (@sp123)


    Hi,

    I removed the h1 headings (the ones shown in the header images) for all pages except the front page. Now I want the entry-title on each page to be h1 and not h2. But I cannot find the right place in the template files to make this change. I tried to change it at every occurence of <h2 class=”entry-title”>, but I can only change it for the front page, not for other pages. Anybody an idea?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you working with a child theme? That would ensure you can keep your changes as the theme is updated.

    May I ask why you want to make the entry-title an h1 rather than the h2? There is an h1.entry-title in the style sheet.

    An easy solution would be to use the h1.entry-title.

    In the pages directory (which you need to place in your child theme with the same directory structure as the original theme), you will find content-front-page.php
    In this file you will be able to define the entry titles as h1. I would change
    <?php the_title( ‘<h2 class=”entry-title”>’, ‘</h2>’ ); ?>
    This should do it for you.

    There is another page in this directory, content-page.php , which already shows the page titles as h1.
    <header class=”entry-header”>
    <?php the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ); ?>

    Does this help?

    Regards,
    Stilman Davis

    Thread Starter sp123

    (@sp123)

    Thank you very much for your reply. Yes, I’m working with a child theme.
    I want to change the heading from h2 to h1 on normal pages (not the front page), because I removed the default h1 heading from the pages (via site-branding.php). I don’t want the h1 in the header images on normal pages. Therefor, I removed it. Now a h1 heading should be on every page, so I need to change the entry-title heading from the default h2 to h1.

    I tried to change all the occurences of h2.entry-header in all templates and all template parts – no luck so far. It’s really weird.

    • This reply was modified 7 years, 8 months ago by sp123.
    Thread Starter sp123

    (@sp123)

    I found the solution. As I am using the Customize Twenty Seventeen plugin (based on Bold Builder), not the standard template is used, but another template in the plugin folder.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘set entry-title to h1 on pages’ is closed to new replies.