Here's a way to switch the <h1> tag to the post or "story" link title on post pages - which should help with SEO. The example is using the default theme. There might be a better way for CSS than my hack but you get the idea to use the <h1> tag on post link titles.
Open up content/themes/default/header.php and find: <!-- TITLE & AD BLOCKS -->
and replace
withPHP Code:<div id="hd_title">
<a href="<?php echo BASEURL; ?>"><?php echo SITE_NAME; ?></a>
</div>
..CSS editPHP Code:<div id="hd_title">
<?php if ($h->pageType == 'post') { ?>
<h2><a href="<?php echo BASEURL; ?>"><?php echo SITE_NAME; ?></a></h2>
<?php } else { ?>
<h1><a href="<?php echo BASEURL; ?>"><?php echo SITE_NAME; ?></a></h1>
<?php } ?>
</div>
Open up content/themes/default/style.css and under
addCode:#hd_title h1 a:hover { color: #000; }
...so the post titles are styled the same on the list and post pages.Code:#hd_title h2 { font-size: 2.2em; font-weight: bold; padding: 0.5em 0.4em 0.4em 0.4em;} #hd_title h2 a { color: #666; } #hd_title h2 a:hover { color: #000; }
Open content/plugins/sb_base/templates/sb_post.php.
Find and replace lines 48 thru 50:
with: (just adding <h1> tags to link titles)PHP Code:<a href='<?php echo $h->post->origUrl; ?>' <?php echo $h->vars['target']; ?> class="click_to_source"><?php echo $h->post->title; ?></a>
<?php } else { ?>
<?php echo $h->post->title; ?>
Open content/plugins/sb_base/templates/sb_list.phpPHP Code:<h1><a href='<?php echo $h->post->origUrl; ?>' <?php echo $h->vars['target']; ?> class="click_to_source"><?php echo $h->post->title; ?></a></h1>
<?php } else { ?>
<h1><?php echo $h->post->title; ?></h1>
Find lines 49 thru 51 and replace:
with: (just adding <h2> tags)PHP Code:<a href='<?php echo $h->post->origUrl; ?>' <?php echo $h->vars['target']; ?> class="click_to_source"><?php echo $h->post->title; ?></a>
<?php } else { ?>
<a href='<?php echo $h->url(array('page'=>$h->post->id)); ?>' <?php echo $h->vars['target']; ?> class="click_to_post"><?php echo $h->post->title; ?></a>
...CSS editPHP Code:<h2><a href='<?php echo $h->post->origUrl; ?>' <?php echo $h->vars['target']; ?> class="click_to_source"><?php echo $h->post->title; ?></a></h2>
<?php } else { ?>
<h2><a href='<?php echo $h->url(array('page'=>$h->post->id)); ?>' <?php echo $h->vars['target']; ?> class="click_to_post"><?php echo $h->post->title; ?></a></h2>
Open the css for the sb_base plugin /content/plugins/sb_base/css/sb_base.css
Find and replace:
With:Code:.show_post_title { font-size: 1.2em; font-weight: bold; }
Now your site name should have <h1> tags on the home and sort pages with post link titles tagged with <h2>... Single story "post" pages these will be swapped so the title link will have the <h1> tags.Code:.show_post_title h1{ font-size: 1.2em; font-weight: bold; } .show_post_title h2{ font-size: 1.2em; font-weight: bold; }![]()


Reply With Quote

Bookmarks