Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Modify H1 Headline for SEO (http://forum.bytesforall.com/showthread.php?t=1123)

idg Apr 6, 2009 04:25 PM

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!

Flynn Apr 6, 2009 06:29 PM

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?>
    }


idg Apr 6, 2009 08:11 PM

Thanks Flynn!

I'll plug this in tomorrow.

wdouzel Apr 6, 2009 09:50 PM

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....)

Flynn Apr 7, 2009 05:22 AM

Yes, make all changes

The first part is for changing the post/page title, the rest is for the blog title

idg Apr 7, 2009 02:02 PM

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?

Flynn Apr 9, 2009 04:10 PM

You're right, the code didn't work right, sorry for that. I updated it, please try again.

idg Apr 9, 2009 08:02 PM

Quote:

Originally Posted by Flynn (Post 4634)
You're right, the code didn't work right, sorry for that. I updated it, please try again.

Excellent, works great!!! :)

kevjazz Apr 20, 2009 02:39 AM

Flynn,
This may be the wrong place for me to put this question. But.... I'm trying to reverse the colors of post headlines so that they are black by default and gray when hovered. Can't find where to make this change. There are no boxes for headlines in the post info items area. Where can I change the color of post headlines?
Thanks,
Kevin:confused:

idg Apr 20, 2009 01:50 PM

Quote:

Originally Posted by kevjazz (Post 5251)
Where can I change the color of post headlines?
Thanks,
Kevin:confused:

Try:

Atahualpa Theme Options / Post Page Styling / Headline Box - Text

and

Atahualpa Theme Options / Post Page Styling / Headline Box - Hover

plug the color in the Text box as: color: #000000; and color: #666666; (or whatever shade you want for hover).

kevjazz Apr 20, 2009 05:54 PM

dg,
Can't believe I missed that. Was looking around for this all day. Thanks so much.
Kevin

frankhamm May 2, 2009 09:29 AM

Quote:

Originally Posted by Flynn (Post 4374)
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

Flynn May 4, 2009 11:05 PM

This will be a theme option in 3.3.3 coming tomorrow. You may not have that code in your older version


All times are GMT -6. The time now is 02:26 AM.

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