Archived topic
Theme Newsroom, blog, H1 is not recognised
29 replies · Started by Manuela on January 14, 2023
Hi
The SEO report indicates that the blog headline (h1) is missing. But, the H1 title is in every post.🤔
Merci for the help
Manuela 🙂
Hi there,
your Blog page is not displaying a H1 Title.
Add this PHP Snippet to your site:
add_filter( 'generate_site_title_output', function( $output ) {
return sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s" rel="home">
%3$s
</a>
</%1$s>',
( ( is_front_page() && is_home() ) || is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
);
});
it will make it so the Site Title gets the H1 tag.
Hi David
In the Content-Single.php or in the Single.php?
Are you using a Child Theme?
If yes, then it goes in the Child Theme > functions.php
If No, then use the Code Snippets plugin ( link in doc below ) and Add New Snippet to add the code.
More info here on adding PHP:
https://docs.generatepress.com/article/adding-php/
Hi David
Merci for the plugin.
I installed it on WordPress and reinserted the code. I have selected "Run snippet everywhere".
But, the problem is not solved, because the SEO tool shows the following: See private area.
What else do I have to adjust?
Thank you Manuela
Those all look like Single Posts, which should automatically display your Post Content Title as the H1.
There are 2 places those can be disabled:
1. In the individual posts Post editor -> Disable Elements meta box:
https://docs.generatepress.com/article/layout-metabox-overview/
2. in a GP Element -> Layout found in Appearance > Elements.
Can you check to see if any of those have the Content Title disabled ?
Hi David
I have checked point 1 and 2, unfortunately still without a solution.
I am also surprised, as I already have experience with some themes. But the H1 has never been an error in the SEO report, as it is always crawlable. It is a mystery to me.
Could i get a temporary admin login to the site ? I can then take a closer look .
Hi David, of course. Then I only need an email address for access. Thank you.
Hallo David
It is the Single Layout element, because the removed site header from single post layout. (Datum der Veröffentlichung: 28. Sep. 2020 um 22:14 Uhr)
If I set the element to draft,
- then the header of the blog post appears twice in each blog post,
- and the header from the page also appears.
Hi Manuela,
Here's an email you can use: support@generatepress.com
Please use the Private Information field to share the credentials afterward: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
We'll check your structure and see what can be done with the Layout Element you have.
Hi Fernando
Ich habe Euch als Benutzer mit der E-Mail-Adresse "support@generatepress.com" angelegt.
Merci for your help.
Manuela
Hi Manuela,
Thank you! Can you set a password for the account and share the credentials here through the Private Information field?
Hi Fernando, view private Information. :-)
Hello Fernando, I hope it works. Otherwise I delete the previously created account and create a new user role again.