• Resolved Michael Adamidis

    (@azzurres)


    Hi,

    I’ve found that my whole website is with a h1 in the main title of the page, and with every post I create, normally I would go for the main title of it as a h1 title. But now for SEO having two h1 titles is a no go.

    “Your page has more than one H1 Tag. It is generally recommended to only use one H1 Tag on a page.
    The H1 Header Tag is an important way of signaling to search engines what your content is about, and subsequently the keywords it should rank for.”

    How could I fix this?

    On my page I’ve found something like:

    This is the first one:
    
    <h1 class="site-title"><a href="https://www.adamidis-art.com/" rel="home">Michael Adamidis Digital Painting Art</a></h1>
    
    
    And here's the 2nd one - the h1 of the main blog post: 
    
    <h1 class="title-post entry-title" >10 Easy Steps - How to Paint a Digital Portrait Painting</h1>
    
    


    Really need to fix that. SEO is essential for my site.
    Btw, I use a snippets plugin, so I could use it to paste fixing PHP code.
    Thanks for your help,

    Michael

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @azzurres,

    To change the default H1 tag to H2, you can overwrite the content-single.php of Sydney theme by duplicating the file to your child theme’s folder and replacing this line:

    <?php the_title( '<h1 class="title-post entry-title" ' . sydney_get_schema( "headline" ) . '>', '</h1>' ); ?>

    to

    <?php the_title( '<h2 class="title-post entry-title" ' . sydney_get_schema( "headline" ) . '>', '</h2>' ); ?>

    Visit this documentation for detailed information about child theme.

    Thread Starter Michael Adamidis

    (@azzurres)

    Hi Kharis,

    using a snippet plugin and insert it in the .php of the page would not be possible? I’ve not jet created a child theme.

    Thread Starter Michael Adamidis

    (@azzurres)

    I see, because it has to be changed, it can not be pasted as a snippet, right?

    I see, because it has to be changed, it can not be pasted as a snippet, right?

    Snippet won’t work for such this case.

    Thread Starter Michael Adamidis

    (@azzurres)

    Sorry, but couldn’t you change this with an update for the theme? I mean this seems to be wrong, as the page’s title shouldn’t be h1.
    Personally, I’m not that keen on creating a child theme just for this.

    Thread Starter Michael Adamidis

    (@azzurres)

    Hi Kharis,

    could you tell me, if this line you gave me is to change a page’s title tag to h2 or the website’s title tag to h2?
    I want to change the website’s (site-title) title tag to h2 or even no heading at all, so the different pages can have their h1 title without a second one of the website.

    Hi @azzurres,

    Thank you for getting back!

    could you tell me, if this line you gave me is to change a page’s title tag to h2 or the website’s title tag to h2?

    The code above is aimed to change the post title tag.

    I want to change the website’s (site-title) title tag to h2 or even no heading at all, so the different pages can have their h1 title without a second one of the website.

    You would need to edit the inc/classes/class-sydney-header.php file to change any H1 tag to H2.

    Thread Starter Michael Adamidis

    (@azzurres)

    Hey Kharis,

    I think, I got it.
    I’ve found this line:

    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

    And in there, I’ve changed it to h2.

    It has worked!
    Now, as I have no child theme, am I correct, that I simply have to always check this file and redo the above work every time I update Sydney, right?

    Thanks so much,
    Michael

    Thread Starter Michael Adamidis

    (@azzurres)

    Now I’ve put the site-title and the site-desciption simply in <span> classes. Is this ok?

    Hi @azzurres,

    Yes, that should be fine: https://i.snipboard.io/NIEKM9.jpg

    Thread Starter Michael Adamidis

    (@azzurres)

    Yes, this works very good.
    Now the site has everywhere one individual h1 for every page.
    Thank you for your help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Title of the website uses h1’ is closed to new replies.