WordPress 2 Columns
It is really easy to make WordPress display ’sidebar’ too when showing single posts. All you need to do is edit the single.php file in your current theme folder. Just change the content class to ‘narrowcolumn’ and add a call to the ’sidebar’ before the ‘footer’ call.
- Go to the theme editor. Appearance/Editor
- Click on Theme Files/Templates/Single post (single.php)
- Alter the CSS class of the content div to “narrowcolumn” instead of “widecolumn”
- Add a line calling get_sidebar() at the end just before the get_footer() call
That is, replace:
<div id="content" class="widecolumn">
with
<div id="content" class="narrowcolumn">
I.E., add the following line (will show sidebar):
<?php get_sidebar(); ?>
before this line:
<?php get_footer(); ?>
- Show sidebar
Now you know how to display Word-Press sidebar with single posts.
Tags: Display wordPress Sidebar, edit single.php, Show Sidebar
I’ve just begun to use Wordpress, so I’m not completely sure of what it means to be able to display a sidebar while display single posts, but you have given me enough info to be dangerous and play around with it…
Thanks
Hi Darvin!
The default WPress does not show the sidebar when viewing single posts, only when viewing the home index page.
Cheers – Rhys