How to Add a WordPress Sidebar to Your Blog

How to Add a WordPress Sidebar to Your Blog

Confused about the difference between a Post and a Page on WordPress?

Posts and Pages are different; when you write a post it goes into the blog’s ‘loop’ (such as in the ‘recent posts’ section), whereas a page is static and stays on the site somewhere in the sidebar (such as an ‘About Us’ or ‘Contact Us’ page).

You may have discovered that some themes will not show the sidebar on WordPress pages. This occurs when you have chosen the ‘static page’ option under the ‘Reading’ menu of the WordPress Dashboard. To fix this, you simply need to read the sidebar to WordPress static pages.

  • Click on the Presentation from the main panel on the WordPress Dashboard (this appears when you log in). Click on Theme Editor.
  • On the right hand side you will see a list of the current theme’s templates. If you see a ‘Page Template’ option, click that and the code will appear in the editing box. Copy all the code in the editor and paste it into the Notepad application as a backup.
  • At the top of the editing box you should see this bit of code:

    <?php get_header(); ?>

    This tells the page to get the themes header, so we will tell the page to get the sidebar.

  • Place your mouse directly behind the above code, and hit the enter key once. Paste this code:

    <?php get_sidebar(); ?>

    Make sure you paste this code between the < > brackets and click “Update File”.

  • If you manage to corrupt your theme’s template files and it no longer displays properly, simply deleted all the edited text you have tampered with and replace it with the backup text you previously pasted into Notepad.

One Response to “How to Add a WordPress Sidebar to Your Blog”

  1. Kel99 says:

    The best place to look for further advice for Wordpress development questions is here: http://codex.wordpress.org

Leave a Reply