Archived topic
blog page missing H1 tag
12 replies · Started by siddharth on September 3, 2019
Blog page missing H1 tag. SEO tools showing error that h1 tag absent on blog page.
Make site title visible, then h1 available ............
i faced same issue....
if you don't want site title visble, then hide with css - use display none for site title class....
This is a small snag in GP !!!
site title is visible...still H1 tag not showing
Hi there,
add this PHP snippet and it will make your Site Title the H1 on the blog page:
add_filter( 'generate_site_title_output', function() {
return sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s" rel="home">
%3$s
</a>
</%1$s>',
( is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
);
} );
I'll have a word with Tom to see if there is anything to make this happen automatically on a separate Blog page
Thanks David...Let me know if this happen automatically.
If you add the code it will automatically add H1 around your Site Title ( in the Navigation Bar )
Dear David,
Please guide me to put h1 on home page around site logo at https://evidencebasedhomeopathy.com/
Regards.
It's not possible to add an <h1> tag for the logo image unfortunately as it's not text.
Couple solutions that might work for you:
- Instead of using a logo image that includes the logo and site title, you can consider having them separated and use the Place logo next to title option:
https://docs.generatepress.com/article/place-logo-next-to-title/
- Add a header element that has <h1> in it:
https://docs.generatepress.com/article/header-element-overview/
Let me know :)
Thanks it works :-)
Awesome :)
Sounds like you'd need the second option here:
https://generatepress.com/forums/topic/blog-page-missing-h1-tag/#post-1000302
If you need further help on this, please open a new topic.
Thanks!