Should homepage have h1 tag
URL to the page in question:
http://tonyschurches.com/
-
Hi Bill
I am looking at the home page.
My goal is to add a logo image in addition to the text logo.
Should the home page have an <h1> tag in in the <header> section ?
And all other pages (not home page) will not have an <h1> in the <header> ?
I have “tagged” the current home page as the home page in every way I know how – but I do not see an h1 tag
I must be missing something.
Thanks
kais
Good Morning Kais,
It should show the h1 tag there on the home page and not on the others. What you can do is make a change to the header so that it always displays as a h1. Here’s how to do that:
- Go to the Appearance section in your WordPress dashboard and choose Edit.
- From the list of files on your right, choose header.php
- Find this section:
<div id="logo">
<?php if(of_get_option('header_blog_title') == 'image') {
if (is_home()) {
echo '<h1><a href="'.home_url().'/"><img src="'.of_get_option('logo','').'" alt="'.get_bloginfo('name').'" /></a></h1>';
} else {
echo '<p><a href="'.home_url().'/"><img src="'.of_get_option('logo','').'" alt="'.get_bloginfo('name').'" /></a></p>';
}
} elseif(of_get_option('header_blog_title') == 'text') {
if (is_home()) {
echo '<h1><a href="'.home_url().'/">'.get_bloginfo('name').'</a></h1>';
} else {
echo '<p><a href="'.home_url().'/">'.get_bloginfo('name').'</a></p>';
}
} ?>
</div>
and change it to be like this:
<div id="logo">
<?php if(of_get_option('header_blog_title') == 'image') {
echo '<h1><a href="'.home_url().'/"><img src="'.of_get_option('logo','').'" alt="'.get_bloginfo('name').'" /></a></h1>';
} elseif(of_get_option('header_blog_title') == 'text') {
echo '<h1><a href="'.home_url().'/">'.get_bloginfo('name').'</a></h1>';
} ?>
- Save your changes.
That should set things so that you always have a H1 tag there. The “rules” here changes somewhat after I made the theme. Now multiple h1 tags are fine with Google as long as they fit together semantically like they should.
Have a great week,
Bill
- The topic ‘Should homepage have h1 tag’ is closed to new replies.