Should homepage have h1 tag

Support Area Forums Photobug Should homepage have h1 tag

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question: http://tonyschurches.com/
  • Author
    Posts
  • #29388
    Kais
    Participant

    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

    #29389
    Bill Robbins
    Moderator

    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:

    1. Go to the Appearance section in your WordPress dashboard and choose Edit.
    2. From the list of files on your right, choose header.php
    3. 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>';
      				
      		} ?>
      
    4. 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Should homepage have h1 tag’ is closed to new replies.