|
#1
Apr 6, 2009, 04:25 PM
|
|
|
21 posts · Mar 2009
Seattle, WA
|
|
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
Apr 6, 2009, 06:29 PM
|
|
|
|
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 04:07 PM.
Reason: Replaced 4 times (is_page() OR is_single() ? "1" : "2") with ( (is_page() OR is_single()) ? "1" : "2")
|
#3
Apr 6, 2009, 08:11 PM
|
|
|
21 posts · Mar 2009
Seattle, WA
|
|
Thanks Flynn!
I'll plug this in tomorrow.
|
#4
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....)
|
#5
Apr 7, 2009, 05:22 AM
|
|
|
|
3,768 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
Apr 7, 2009, 02:02 PM
|
|
|
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
Apr 9, 2009, 04:10 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
You're right, the code didn't work right, sorry for that. I updated it, please try again.
|
#8
Apr 9, 2009, 08:02 PM
|
|
|
21 posts · Mar 2009
Seattle, WA
|
|
Quote:
Originally Posted by Flynn
You're right, the code didn't work right, sorry for that. I updated it, please try again.
|
Excellent, works great!!!
|
#9
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
|
#10
Apr 20, 2009, 01:50 PM
|
|
|
21 posts · Mar 2009
Seattle, WA
|
|
Quote:
Originally Posted by kevjazz
Where can I change the color of post headlines?
Thanks,
Kevin
|
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).
|
#11
Apr 20, 2009, 05:54 PM
|
|
dg,
Can't believe I missed that. Was looking around for this all day. Thanks so much.
Kevin
|
#12
May 2, 2009, 09:29 AM
|
|
|
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 03:26 PM.
|
#13
May 4, 2009, 11:05 PM
|
|
|
|
3,768 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
|
|