How to Show Sidebars in WordPress Posts and Pages?

  • Sharebar

In the following, I’ll explain the steps I took to add the sidebar to all posts and pages:

    1. The first step is to login to your administration panel.
    2. Click the Design tab from the admin navigation menu.
    3. Select the Theme Editor tab from the administration sub-menu.
    4. Now select the WordPress default theme within the theme editor window from the drop down menu under themes to edit.
    5. Find and select the single post theme file (single.php) from the WordPress default theme files to the right. You should now see Editing single.php at the top of the theme editor.
    6. Near the top of the file, find where it says:

      <div id="content">

    7. Change widecolumn to narrowcolumn so the code looks like the following:

      <div id="content">

    8. Now scroll down to the bottom of the file and find where it says:

      <?php get_footer(); ?>

    9. Directly above this add the following:

      <?php get_sidebar(); ?>

    10. Your final entry at the end of the single.php file should look like this:

      <?php get_sidebar(); ?>

      <?php get_footer(); ?>

    11. Once edited, simply click the update file button at the bottom right and go view your site. You should now have a sidebar on your post pages.

Note: You may also wish to remove the call to sidebar code from your 404.php error page. You can find it in the same way you found and edited the post.php.

You can leave a response, or trackback from your own site.