Community Information
-
How to format the H1 Tag for the homepage
I've been running the code below in my header.php for years, on a Wordpress website. But I'm wondering if it's still valid in 2025. I do have the Yoast SEO which also sets a title for the page and description, but I'm also interested if the H1 tag should contain the same tagline as entered in Yoast Settings or any other SEO tool. Thank you! <div class="brand"> <?php if ( is_home() ) : ?> <h1 class="site"><a title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'url' ); ?>"> Title<span>Tagline</span> </a></h1> <?php else : ?> <h2 class="site"><a title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'url' ); ?>"> Title<span>Tagline</span> </a></h2> <?php endif ?>5
© 2025 Indiareply.com. All rights reserved.