Codeable info

How To Display Different Sidebars On Your Posts And Pages

Posted on by in Blog

Adding multiple sidebars to your theme is very easy but what to you do if you want to use a different sidebar with every post or page? Forum member deepakraj asked this very question recently.

As with any WordPress problem, there are a few solutions available. If you only want to show a different sidebar on a few pages, you could create a new page template and register a different sidebar.

Another solution to displaying a unique sidebar on posts and pages is to use custom fields . It’s very easy to implement though in my opinion using a plugin is a much simpler and user friendly solution.

I tried 5 different sidebar generator plugins. Sidebar Generator Plugin, WP Sidebars and WordPress Custom Sidebar unfortunately didn’t work. Content Aware Sidebars and Custom Sidebars worked well though.

Content Aware Sidebars

Creating new sidebars using Content Aware Sidebars is very straight forward. With each sidebar you can select which post, page, category, tag or page template it is displayed on. You can also display it on the front page, 404 page and search results.

Content Aware Sidebars

You can choose which sidebar area your new sidebar replaces. Alternatively, you can place your new sidebar at the top or bottom of another one. This is useful if you simply want to add one or two things to an existing sidebar.

Custom Sidebars

If you prefer to set the sidebar directly in the post or page editor, you should consider using Custom Sidebars. In the settings area you define your sidebar and choose which widget areas that can be replaced.

Custom Sidebars

In your post or page editor you will see the widget areas that you selected in the settings area. All you need to do is select which sidebar you want to add it to.

Custom Sidebars

It’s hard to choose between Content Aware Sidebars and Custom Sidebars. Both will help you add custom sidebars to your posts and pages so it really comes down to whether you prefer choosing your sidebar on a per post/page basic or whether you prefer to organise everything from the one page.

I recommend giving both a try and then deciding which one is best for you.

Good luck,

Codeable info

Comments (6)

Comment by muppet says:

why didnt you just code it in your self, not that hard to do, also theres now woo sidebars plugin

Comment by JhezeR says:

I use widget logic plugin, very simple

Comment by Kevin Muldoon says:

Thanks for bringing it to my attention. Looks pretty good. I’m surprised I didn’t find it when I was looking for a good plugin :)

Comment by Kevin Muldoon says:

I think that’s a good idea if you only have a few sidebars, but what if if you have 20 different sidebars for 20 different pages. In that scenario, I believe a plugin is better than 20 page templates.

Comment by Tom Salzer says:

There is also Widget Logic, a plugin I’ve used to provide some “value added” sidebar content related to the page being called. Link:

Comment by Nitin Reddy Katkam says:

I would use a different template for a page and a different template for a post simply because it does not require an additional plugin. More plugins translates to more overhead but then again, most WordPress-driven sites use some form of caching to deal with it.

Codeable info