Posts Tagged ‘Display wordPress Sidebar’

Display WordPress Sidebar With single Posts

Saturday, October 24th, 2009
  • display-wordpress-sidebarWordPress 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.

  1. Go to the theme editor. Appearance/Editor
  2. Click on Theme Files/Templates/Single post (single.php)
  3. Alter the CSS class of the content div to  “narrowcolumn” instead of “widecolumn”
  4. That is, replace:

    <div id="content" class="widecolumn">

    with

    <div id="content" class="narrowcolumn">
  5. Add a line calling get_sidebar() at the end just before the get_footer() call
  6. 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.