Different pages, different sidebars in WordPress 1.5

David emailed me today to ask how I managed to have a different sidebar in my blog, as opposed to the other pages on the site. Sounds like a straightforward question, but with the new theme structure in WordPress 1.5, it isn’t as straightforward as you might first imagine.

First off you need to know that you can create Pages in WordPress – so, for instance, the Services page, the Home page and the Contact Me page on this site, were all created in WordPress.

Knowing that, the next thing to realise is that pages created in WordPress can be associated with individual templates.

How does this all help me? Well, what I did was to create template files, based on the home.php file which ships with Kubrick (Kubrick is the default theme which ships with WordPress 1.5 and currently the theme deployed on this site), and I associated the pages I created with their template files.

Then I edited the template files, removing the call for the sidebar ( ?php get_sidebar(); ?), I copied the code from sidebar.php into the template files, where the call to sidebar was, and I edited the code to only display the links I wanted.

If you enjoyed this post, make sure you subscribe to my RSS feed!

4 Responses to “Different pages, different sidebars in WordPress 1.5”


  1. 1 Per Olav Eidsvoll

    Thanks alot:)
    I use WP 2.0 but I will give this a try:)

    Great site, keep up the good work :-D

  2. 2 Tom Raftery

    Thanks Per – best of luck with it.

  3. 3 Peter Knight > EdenWeb

    Brilliant – I was just this minute trying to figure out the exact same thing and decided to Google it. Thanks for sharing!

  1. 1 davids brain blog

Leave a Reply