Many WordPress themes do not yet provide a way to have totally different sidebar content on different pages of your site. Some may provide a little flexibility with, for example a sidebar for the blog and a different sidebar for static pages, but sometimes you need more comprehensive control – for example you may need an additional set of navigation on a certain set of sub-pages. There’s several different plugins that help you gain this type of flexibility with your site.
The Display Widgets plugin is perhaps the simplest and most user-friendly option. After activating the plugin you will notice that when you add a widget to your sidebar, there is a system of checkboxes whereby you can easily tell the widget to show up, or not to show up on certain pages/posts or types of pages/posts. In addition you can choose to display a widget based on whether a user is logged in or not, which would be handy if you have any kind of membership site or protected content pages. This plugin is easy enough for beginners to use!
The Dynamic Widgets plugin does a very similar job to Display Widgets, but adds a couple of extra controls for widgets which you may find useful. The interface is perhaps not as immediately easy to use as Display Widgets, becuase it actually takes you to a separate page to control the settings for each widget, but the extra features, provided by checkboxes are:
- Display widget according to the user’s role, including any custom roles you have created
- Display according to date – this could be really handy if you want to run a promotion of some kind – you can specify the dates a widget can be shown
- Display according to browser – not sure how you might use this (other than telling people on Internet Explorer 6 to upgrade…) but it sure is cool!
Widget Logic Plugin
This was one of the original plugins I used for controlling widgets and I’m including it in the list for more advanced users who don’t want to deal with checkboxes and are comfortable with WordPress conditional tags. This plugin adds a simple field to each widget which requires you use a conditional tag to control where the widget displays. It’s not too hard once you understand it, but definitely not user-friendly off the bat.
For example, to make the widget show up only on single post pages, you would enter the tag: is_single()
To make it show up on a specific post or page you need the ID number of the page which is not readily available on any admin screen. You need to actually look in the url when editing a post/page to look for the id number. Or you can install this handy plugin called Reveal IDs which will conveniently show the IDs in a column inside the admin area. So you identify a page/post that you want a widget to display on, locate the ID and use the following tag: is_single( ‘106’ )
where 106 is the ID of that page/post.
You can do all sorts of combinations to test for things like sub-pages etc. Anything you can do with a conditional tag, you can apply to a widget.
These three plugins so far have given you control over where and how individual widgets show up in the existing sidebars your theme already provides. So this means that when in your Widgets screen, you’ll see a sidebar are with several widgets inside, some of which show throughout the site, and some that show only on certain pages. There’s nothing wrong with this set up, although if you have a lot of widgets it could be confusing to keep things organized and to determine at a glance which widget is going to show up in which sidebar.
So another approach is to use a plugin that enables you to create entirely new sidebar areas that appear on your Widgets screen.
Custom Sidebars Plugin
With this plugin you can create new sidebars to use in your theme and you can then designate which sidebar shows up on which page. The interface is not particularly user-friendly, but once you get how it works, it does do the job nicely. It’s a 4-step process.
- You have to specify which of your current sidebars are “replaceable”. This means you can choose to replace one of your theme’s default sidebars with a custom one.
- After you have selected one that can be replaced, you can then make a new sidebar.
- Now when you are on your page editing screen you’ll have a box and drop down where you can specify which sidebar will show up on that page.
- You add widgets to that particular sidebar on the Appearance > Widgets screen as usual.
So now when you go to your Widgets screen you will see a dedicated area for the new sidebar you have created:
Per Page Sidebars Plugin
This plugin does the same job as custom sidebars but has a little better workflow. On your page editing screen you will now see a box where you can enable a custom sidebar for that page, and choose which of your current sidebars you would replace.After you make your selection and save the page, when you head over to the widgets screen you’ll see a new widget area labelled with your page name.
Both plugins seem to work equally fine – the only difference would be your preference for which workflow you prefer.