How to add a sidebar to the individual post pages in the default WP2 theme.
I had the desire to add the sidebar to the individual posting pages for two main reasons.
1) If my visitors navigated into the site and then couldn’t figure out how to get back to the home page they might bail out.
2) If a search engine brought visitors to a particular page I wanted them to be able to further explore the site from there.
Turns out it was EXCEPTIONALLY easy to do this.
All you need to do is edit ‘single.php’ as follows:
Change the second line which currently reads:
<div id=”content” class=”widecolumn”>
To have a class=”narrowcolumn”>
Add the following line just before the last line on the page (before <?php get_footer(); ?>):
<?php get_sidebar(); ?>
Now pop open a cold one and admire your handy work.
- The topic ‘How-to: Add Sidebar to Post Pages in WP2 Default Theme’ is closed to new replies.