• Resolved Mystique Escort

    (@mystique-escort)


    Hello,

    I googled for hours and didn’t find a solution.

    Here is my problem:

    I have two h1 tags on every page. I only want one.
    The one I want to get rid of is
    <h1><a class=”site-title” href= …

    I tried various versions of display:none in the css but nothing worked.

    – I want my site title to be only displayed on the home page. I don’t want the h1 site title displayed on every other page.

    – I want the page title to be the only one h1 tag.

    You’re my last hope!

    Thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • Please give your site url

    Thread Starter Mystique Escort

    (@mystique-escort)

    Hi Menaka.

    The site is http://besterprivatkredit.de/.

    If you go here for example: http://besterprivatkredit.de/bon-kredit/ and check the source code, you’ll see I have

    <h1><a class=”site-title” href=”http://besterprivatkredit.de/&#8221; title=”Bester Privatkredit

    and a little down the line you find

    <h1 class=”entry-title format-icon”>Bon Kredit

    I only want the last one to show up and get rid of the first h1 tag with site-title. I only want the entry-title to show in h1 on my pages.

    Thanks in advance

    Please add this to your child theme’s style.css

    .tc-header .brand .site-title {
      display: none;
    }
    Thread Starter Mystique Escort

    (@mystique-escort)

    I did.

    Didn’t change anything. It’s still in the style.css so you can see for yourself.

    I can see the change. Do refresh your cache.

    Thread Starter Mystique Escort

    (@mystique-escort)

    It is still showing in the source code and I’m still getting a “Duplicate H1 tags” error shown when I run my analysis.

    Thread Starter Mystique Escort

    (@mystique-escort)

    The question is, how do I get rid of it in the source code?

    Is there a way – if we can’t eliminate the site-title completely – to change it to h2 or h3, so it doesn’t mess up my H1 tags?

    Hi,
    To eliminate it, you can add this to your child theme’s functions.php

    add_filter( 'tc_site_title_tag', 'my_title_tag' );
    
    function my_title_tag($content) {
    return "";
    }

    To change to h2/h3 add this to your child theme’s functions.php

    add_filter( 'tc_site_title_tag', 'my_title_tag' );
    
    function my_title_tag($content) {
    return "h2"; //Change to h3 if needed
    }
    Thread Starter Mystique Escort

    (@mystique-escort)

    Yay!!!

    Thanks a lot, Menaka!

    Used the 2nd option because the first showed a “<>” in a line above the site title on the page.

    Option 2 works perfectly. Changed it to h3.

    Again, I appreciate your time and effort! Thank you!

    Glad that it worked.
    Can you please mark the post as resolved?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove site-title h1 tag from pages’ is closed to new replies.