Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

Modify H1 Headline for SEO


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 6, 2009, 03:25 PM
idg
 
21 posts · Mar 2009
Seattle, WA
Help Modify H1 Headline for SEO

I don't use the Blog Title option for my layout, which is typically given the H1 Tag. All my posts, and page titles are using H2, which isn't giving me the benefit of H1 for Google SEO.

Is there a way to have Atahualpa assign H1 Tags to post headlines and H2 tags to "linked" post headlines, like would show up in Excerpts? This would give me the H1 tag on individual post pages, but keep multiple H1's off on a category listing page of posts which Google doesn't like.

The "Post/Page Stying" menu has options for CSS styling of each of these items, so I'm guessing some ID is being generated in Atahualpa for the different headline states.

Thanks in advance for any help!
  #2  
Old Apr 6, 2009, 05:29 PM
Flynn's Avatar
Flynn
 
3,763 posts · Oct 2008
Munich, Germany
Code updated April 9, 2009.

Code updated again April 11, 2009. See bottom of this post.


I will change this in the next version. For now you would have to edit index.php

PHP Code:
        <!-- Post Headline -->                    
        <div class="post-headline">    
        <h2><?php 
        
if( !is_single() AND !is_page() ) { ?>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 
            
if (function_exists('the_title_attribute')) { 
                
the_title_attribute();
            } 
            elseif (
function_exists('the_title')) { 
                
the_title();
            } 
?>"><?php 
        
the_title(); 
        if( !
is_single() AND !is_page() ) { ?>
            </a><?php 
        
?>
        </h2>
        </div>
to

PHP Code:
        <!-- Post Headline -->                    
        <div class="post-headline">    
        <h<?php echo ( (is_page() OR is_single()) ? "1" "2"); ?>><?php 
        
if( !is_single() AND !is_page() ) { ?>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 
            
if (function_exists('the_title_attribute')) { 
                
the_title_attribute();
            } 
            elseif (
function_exists('the_title')) { 
                
the_title();
            } 
?>"><?php 
        
the_title(); 
        if( !
is_single() AND !is_page() ) { ?>
            </a><?php 
        
?>
        </h<?php echo ( (is_page() OR is_single()) ? "1" "2"); ?>>
        </div>
To make this useful for thos who DO use the blog title: To make the blog title H2 on single post and page pages:

Edit functions/bfa_header_config.php:

PHP Code:
ob_start(); bloginfo('name'); $logo_area .= '<h1 class="blogtitle"><a href="' 
get_option('home'). '/">' ob_get_contents() . '</a></h1>'ob_end_clean(); 
to

PHP Code:
ob_start(); bloginfo('name'); $logo_area .= '<h' . ( (is_page() OR is_single()) ? "2" "1") . ' class="blogtitle"><a href="' 
get_option('home'). '/">' ob_get_contents() . '</a></h' . ( (is_page() OR is_single()) ? "2" "1") . '>'ob_end_clean(); 
And in style.css

HTML Code:
h1.blogtitle {
    display: block;
    /* more  ... */
    }
    
h1.blogtitle a:link, 
h1.blogtitle a:visited, 
h1.blogtitle a:active {
    text-decoration: none;
    /* more  ... */
    }
    
h1.blogtitle a:hover {
    text-decoration: none;
    /* more  ... */
    }
to
HTML Code:
h1.blogtitle,
h2.blogtitle {
    display: block;
    /* more  ... */
    }
    
h1.blogtitle a:link, 
h1.blogtitle a:visited, 
h1.blogtitle a:active,
h2.blogtitle a:link, 
h2.blogtitle a:visited, 
h2.blogtitle a:active {
    text-decoration: none;
    /* more  ... */
    }
    
h1.blogtitle a:hover,
h2.blogtitle a:hover {
    text-decoration: none;
    /* more  ... */
    }
And in header.php
PHP Code:
h1.blogtitle {
    <?php echo $bfa_ata['blog_title_style']; ?>
    }
    
h1.blogtitle a:link, 
h1.blogtitle a:visited, 
h1.blogtitle a:active {
    color: #<?php echo $bfa_ata['blog_title_color']; ?>;
    font-weight: <?php echo $bfa_ata['blog_title_weight']; ?>;
    }
    
h1.blogtitle a:hover {
    color: #<?php echo $bfa_ata['blog_title_color_hover']; ?>;
    font-weight: <?php echo $bfa_ata['blog_title_weight']; ?>;
    }
to
PHP Code:
h1.blogtitle,
h2.blogtitle {
    <?php echo $bfa_ata['blog_title_style']; ?>
    }
    
h1.blogtitle a:link, 
h1.blogtitle a:visited, 
h1.blogtitle a:active,
h2.blogtitle a:link, 
h2.blogtitle a:visited, 
h2.blogtitle a:active {
    color: #<?php echo $bfa_ata['blog_title_color']; ?>;
    font-weight: <?php echo $bfa_ata['blog_title_weight']; ?>;
    }
    
h1.blogtitle a:hover,
h2.blogtitle a:hover {
    color: #<?php echo $bfa_ata['blog_title_color_hover']; ?>;
    font-weight: <?php echo $bfa_ata['blog_title_weight']; ?>;
    }
Added April 11 - 2009

Also in style.css
HTML Code:
div.post-headline h2 {
    margin: 0;
    padding: 0;
    /* more  ... */
    }

div.post-headline h2 a:link, 
div.post-headline h2 a:visited, 
div.post-headline h2 a:active {
    /* more  ... */
    }

div.post-headline h2 a:hover {
    /* more  ... */
    }
to

HTML Code:
div.post-headline h1,
div.post-headline h2 {
    margin: 0;
    padding: 0;
    /* more  ... */
    }

div.post-headline h1 a:link, 
div.post-headline h1 a:visited, 
div.post-headline h1 a:active,
div.post-headline h2 a:link, 
div.post-headline h2 a:visited, 
div.post-headline h2 a:active {
    /* more  ... */
    }

div.post-headline h1 a:hover,
div.post-headline h2 a:hover {
    /* more  ... */
    }
and

in header.php

PHP Code:
div.post-headline h2 {
    <?php echo $bfa_ata_post_headline_style_text?>
    }

div.post-headline h2 a:link, 
div.post-headline h2 a:visited, 
div.post-headline h2 a:active {
    <?php echo $bfa_ata_post_headline_style_links?>
    }

div.post-headline h2 a:hover {
    <?php echo $bfa_ata_post_headline_style_links_hover?>
    }
to
PHP Code:
div.post-headline h1,
div.post-headline h2 {
    <?php echo $bfa_ata_post_headline_style_text?>
    }

div.post-headline h1 a:link, 
div.post-headline h1 a:visited, 
div.post-headline h1 a:active,
div.post-headline h2 a:link, 
div.post-headline h2 a:visited, 
div.post-headline h2 a:active {
    <?php echo $bfa_ata_post_headline_style_links?>
    }

div.post-headline h1 a:hover,
div.post-headline h2 a:hover {
    <?php echo $bfa_ata_post_headline_style_links_hover?>
    }

Last edited by Flynn; Apr 9, 2009 at 03:07 PM. Reason: Replaced 4 times (is_page() OR is_single() ? "1" : "2") with ( (is_page() OR is_single()) ? "1" : "2")
  #3  
Old Apr 6, 2009, 07:11 PM
idg
 
21 posts · Mar 2009
Seattle, WA
Thanks Flynn!

I'll plug this in tomorrow.
  #4  
Old Apr 6, 2009, 08:50 PM
wdouzel's Avatar
wdouzel
 
5 posts · Mar 2009
Send a message via Skype™ to wdouzel
Flynn, please a small clarification for non coders regarding these changes for those who DO use the blog title:

Do we make the first set of changes in index.php AND then the rest, or do we start with the bra_header_config.php and work down?

Thanks.

(Interesting that at least three of us came by within a few hours of each other regarding the same issue....)
  #5  
Old Apr 7, 2009, 04:22 AM
Flynn's Avatar
Flynn
 
3,763 posts · Oct 2008
Munich, Germany
Yes, make all changes

The first part is for changing the post/page title, the rest is for the blog title
  #6  
Old Apr 7, 2009, 01:02 PM
idg
 
21 posts · Mar 2009
Seattle, WA
Hi Flynn,

I put the code in today, checked with Firebug and it changes the headlines to H1, which is great. However, when I generate a list of posts in a category, the multiple excerpt headlines are also H1 (not H2). Google penalizes for more than one H1 on a page.

Any thoughts?
  #7  
Old May 2, 2009, 08:29 AM
frankhamm
 
35 posts · Jan 2009
56459 Mähren - Germany
Quote:
Originally Posted by Flynn
Code updated April 9, 2009.

Code updated again April 11, 2009. See bottom of this post.


Edit functions/bfa_header_config.php:

PHP Code:
ob_start(); bloginfo('name'); $logo_area .= '<h1 class="blogtitle"><a href="' 
get_option('home'). '/">' ob_get_contents() . '</a></h1>'ob_end_clean(); 
to

PHP Code:
ob_start(); bloginfo('name'); $logo_area .= '<h' . ( (is_page() OR is_single()) ? "2" "1") . ' class="blogtitle"><a href="' 
get_option('home'). '/">' ob_get_contents() . '</a></h' . ( (is_page() OR is_single()) ? "2" "1") . '>'ob_end_clean(); 
[/php]

I am using Atahulpa Version 3.2 and I am not able to finde the code snippet to edit in functions/bfa_header_config.php

Am I too blind to see it? Also the search function of my editor ws not successful.

Flin want I am doing wrong? I also want to make my theme a little mre seo

Thanks in advance

Last edited by frankhamm; May 2, 2009 at 02:26 PM.
  #8  
Old May 4, 2009, 10:05 PM
Flynn's Avatar
Flynn
 
3,763 posts · Oct 2008
Munich, Germany
This will be a theme option in 3.3.3 coming tomorrow. You may not have that code in your older version

Bookmarks

Tags
h-1, headline, seo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: Cannot modify header information - headers already sent by ... bruno-d-horse New Versions, & Updating 5 Mar 31, 2010 02:29 AM
How to modify the links below each post on the homepage ? ( Date, tags , Leave a com. 3ukman Header configuration & styling 5 Jul 10, 2009 11:05 AM
HEADLINE Box: Text hectorchavanajr Header configuration & styling 4 Jun 30, 2009 11:39 AM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 07:50 AM
[SOLVED] Comment Reply Headline? mcphoto Comments, trackbacks & pings 4 May 6, 2009 07:44 AM


All times are GMT -6. The time now is 12:58 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.