The default Template of WordPress don’t show the Sidebar on each page. One of the pages without sidebar is the comment page. I don’t like this behavior because a page without main navigation is a bit deceptive. To change this, we only need to change a few lines of code:
- in single.php
change the style of the div from widecolumn to narrowcolumn :<div id="content" class="narrowcolumn">
at the end of the file add
<?php get_sidebar(); ?>
before
<?php get_footer(); ?>
- in header.php
to give the sidebar the light gray background, we need to remove the if in the middle of the file. Change<?php
// Checks to see whether it needs a sidebar or not
if ( !$withcomments && !is_single() ) {
?>
#page { background: url("<?php bloginfo(...repeat-y top; border: none; }
<?php } else { // No sidebar ?>
#page { background: url("<?php bloginfo(...repeat-y top; border: none; }
<?php } ?>
to:
#page { background: url(" <?php bloginfo('stylesheet_directory'); ?> /images/kubrickbgwide.jpg") repeat-y top; border: none; }
If you want to add a Home Link into the comments page, extend the link area in single.php:
<div class="navigation"> <div class="alignleft"><?php previous_post_link('« %link') ?></div> <div><a href="<?php echo get_option('home'); ?>/">Home</a></div> <div class="alignright"><?php next_post_link('%link »') ?></div> </div>
Pingback: Gen Drebery