Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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


 
Prev Previous Post   Next Post Next
  #2  
Old Apr 6, 2009, 05:29 PM
Flynn's Avatar
Flynn
 
3,768 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")
 

Bookmarks

Tags
h-1, headline, seo



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 03:19 AM.


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