X

H1 Site Title Only on Home Page

For best SEO, your site title should be wrapped in an H1 tag for the home page but then in a div tag for the rest of the site (as the page or post title should be h1).

Put this snippet in your header.php file to display your site name as h1 on the front page and in a div everywhere else.

Change is_front_page() on line 2 to is_home() if your blog page is your home page.

Use #site-title for your css selector to style the title only once.

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!