• Hi ya’ll.

    I use the twentythirteen theme and I want to remove the H1 and H2-tag from the site-title and site-description on all my pages, except for the homepage.

    The site-title is displayed in the header.php:

    <h1 class=”site-title”>Site title</h1>
    <h2 class=”site-description”>Descrition</h2>

    I do want to keep the site-title and description displayed on all pages, but only on the home-page with the H12 and H2-attribute.

    I have a child theme, so that might makes it easier to realize.

    I hope anyone can help. Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Erik86

    (@erik86)

    Anyone?

    you could try:

    if (is_front_page()){ echo '<h1 class="site-title">Site title</h1>';

    Or something like that… basically you’re testing that the page is the front-page and if it is displaying the H1 and H2 tag otherwise display whatever else you want if it isn’t.

    Thread Starter Erik86

    (@erik86)

    Hi pdxchabers,

    Thank you.

    The testing part must be if (is_front_page() right?

    What is the second part? And where should I put his code? In every page on my website?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove H1 tag from site-title, except on homepage’ is closed to new replies.