Reply To: how to add a h1 tag to my homepage?

Home Forums Support how to add a h1 tag to my homepage? Reply To: how to add a h1 tag to my homepage?

#158783
Tom
Lead Developer
Lead Developer

Hi Sven,

Great find!

I would make it default behavior, but it might cause a change in the way some people are using their headers on updates. I try to make it so the updates don’t change anything drastic.

Also, not everyone uses a site title in their header – some use a logo or header.

For people using a logo or header, they can do something like this:

add_action( 'generate_before_main_content', 'generate_add_blog_title' );
function generate_add_blog_title()
{
	if ( ! is_home() )
		return;
	?>
	<header class="page-header">
		<h1 class="entry-title" itemprop="headline">My Blog Title</h1>
	</header>
	<?php
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/