For the past few months I have used the Widget Context plugin on my WordPress blog in order to control where widgets show up on my site. Everything you see in the two right-hand columns of my site is widget-based, as are the 3 columns that display teasers for featured posts.
But I don’t want all these sidebar and teaser goodies to show up in exactly the same way on every part of my blog, which is where Widget Context comes in. It is one of several different plugins that promise greater control over where widgets appear, so that you can establish different settings for each widget.
My ideal case is a plugin that lets me determine where an individual widget appears based on my choice of:
- page type (for example, single post vs blog page vs category archive)
- category or tag (setting a widget to appear or hide on any post belonging to a specific category)
- specific URL
After several months of using Widget Context I decided to try out some alternatives. Below, you’ll find my summary of how each of four different plugins works:
- Widget Context
- Widget Logic
- Display Widgets
- TS Custom Widgets
1. Widget Context
Widget Context gives you an extra menu within the configuration box for each individual widget, on the widgets page. It’s pretty much exactly what I needed, except for the fact that the “target by URL” feature is glitchy; I haven’t been able to set my widgets to show/hide by category or URL, only by page type.
If you’re only planning to control widgets by page type, this is your easiest option. If you want to control widgets by referencing specific URLs or categories, you can check out the solutions described here, but be prepared for having to find a Plan B. That’s why I tried out the plugins below.
And don’t be afraid to try out Widget Context first, and look for alternatives only if needed.Widget Context remembers the settings for each widget even if you deactivate the plugin and then reactivate it later. So you can configure your widgets in Widget Context, and if you decide to try something else, come back to Widget Context without losing your settings.
2. Widget Logic
Widget Logic uses code to customize each widget by giving you access to WordPress’ system of conditional tags. Once you activate the plugin you will see a new field inside the configuration box for each of your widgets, which you can use to enter a rule about where that widget should appear or hide.
It’s efficient but you have to be comfortable working with code, figuring out logic and looking up the numbers for any categories or tags. The easiest way to get a sense of the kind of code this involves is to look at the list of examples on the plugin’s documentation page or read this handy overview of how to use it.
For example, to get my podcast widget to show up on any single blog post in the “HBR” category, AND on the home page, I entered: in_category(711)||is_home() This worked perfectly: the widget showed up exactly where it was supposed to and the pages loaded nice and fast.
Note that any typos in your code produce ugly errors so be sure to check the posts/pages where you expect you widget to appear (or hide) to make sure you haven’t got any ugly glitches.
If you’re comfortable working with a little bit of code this may well be the option you like best. If you don’t want to deal with anything code-like, or you are planning to work with lots of category and tag rules (which will require you to look up the category and tag number each time) you may find it a bit of a hassle.
3. Display widgets
Display Widgets gives you a scrollbox inside each widget’s settings box, with checkboxes for each page, category or page/post type on the site. You choose either “hide on selected” or “show on selected” and then choose the pages, categories and page/post types to exclude/include.
It works, though it seemed to slow my site significantly. Some other limitations:
- Can’t filter on tags, just categories.
- Doesn’t work for widgets written in the pre-2.8 format. On my blog that meant it worked on “category posts” “text” and “archives” but not “related posts” “simple image” or “find me on”, “random image”.
If you are only trying to exercise nuanced controls over widgets that are 2.8-based and therefore friendly to Display Widgets, this could be a better option that Widget Context since the category-based filtering seems to work better. But bear in mind that you have no option for controlling your widgets’ placement by specific URL or by tag. Most crucially, prepare yourself for switching back-and-forth between plugin options if it turns out that you want to control a widget that isn’t supported by this plugin.
4. Custom widgets
With Custom Widgets you start by setting up your widgets, then go to a different settings page for Custom Widgets. From there you go to the settings page for that individual widget. There are a LOT of customization options but you have to keep track of which widget you are customizing, which can be tricky if you have widgets with duplicate titles (for example, my “simple image” widget, which i use multiple times.) Note that this is an older plugin so may not work with upcoming versions of WordPress.
It works but it is a VERY cumbersome configuration process. Personally I find the idea of learning enough PHP to use Widget Logic a lot less daunting than using Custom Widgets. It’s hard for me to imagine a use case for this plugin, unless you are (a) customizing only one or two widgets, (b) totally unwilling to do any coding as required by Widget Logic, and (c) desperate to limit a widget’s appearance by category or tag (which is what doesn’t seem to work in Widget Context.)
Results
Widget Logic is the best option in terms of getting the display results I want; Widget Context is the easier plugin to configure. So why choose? I have activated both plugins and it’s relatively easy to use them together.
Just use Widget Context for any widget you want to customize by page type (for example, show only on category archives) and then use Widget Logic if you want to customize by category, tag or URL. When you’re using Widget Logic to control a widget, just leave the Widget Context options set to “Hide on selected” and leave everything unchecked.
Don’t try to combine the two plugins on a single widget; I tried a variety of combinations and found that I couldn’t get the results I wanted by combining the two. But I tested pages that had some widgets controlled by Widget Logic, and others combined by Widget Context, and everything behaved as intended.
Very useful post, thank you.
I am a new WP user setting up a website for my wife's business http://www.designforlifecoaching.com (in its very early stages right now), and love the power of WP but don't want my website to look too much like a blog.
I was using Custom Widgets, but since I am now aware of these other products I will give them a try also. In my case I am attempting to add widgets on a per-page basis and Custom Widgets seems to do that just fine.
Thanks again for the info!
dazzlr
Very useful post, thank you.
I am a new WP user setting up a website for my wife's business http://www.designforlifecoaching.com (in its very early stages right now), and love the power of WP but don't want my website to look too much like a blog.
I was using Custom Widgets, but since I am now aware of these other products I will give them a try also. In my case I am attempting to add widgets on a per-page basis and Custom Widgets seems to do that just fine.
Thanks again for the info!
dazzlr
Thanks for the research. It seems 'Widget Logic' and 'Display Widgets' merely prints or deletes the contents of the sidebar blocks, leaving the sidebar DIVs in place. Whereas 'Widget Context' actually controls whether or not the sidebars get rendered at all. This is important because if you use either of the first two, with widgets created for both sidebars, all your pages will be identified to the CSS as three-column, even ones you choose not to display any widgets. This is particularly important if you use a dynamic template, like K2. Other templates may not be bothered as much.
__
Alexandra Samuel, Ph.D.
Director, Social + Interactive Media Centre
Emily Carr University
alex@alexandrasamuel.com
tel. 604.630.4545
cel. 604.726.5445
Twitter/AIM/Skype awsamuel
you are missing wordpress reusables (it's a nice alternative view on the same problem) http://wordpress.org/extend/plugins/reusables/ check it out 🙂
Here is another you might like to include in your blogpost / review:
http://www.qurl.nl/dynamic-widgets/
Here is another you might like to include in your blogpost/review:
http://www.qurl.nl/dynamic-widgets/
Thank you very much for your review. A search of WordPress.org wasn't generating a list of potentials. Thanks to you I have installed several and found Display Widgets to be exactly what I needed.
Cool post……. not lot of people look for such topics but the one’s who land here , go back with a better solution
THANKS 🙂
This was so helpful. Thanks so much. I love the fact that your a geeky woman. Not many of us around! ^_^
Don’t forget about Total Widget Control, http://codecongo.com/items/1/Total-Widget-Control.html Personally I think it dominates over any other widget management plugin.
It provides the ability to assign widgets to posts, pages, clts, categories, taxonomies, post tags.. Also the ability to show widgets to specific user groups or after a publishing date. Also has the ability to display widgets to all child objects of pages, categories and such. Phenomenal plugin!
Thanks for this article. Widget logic wasn’t working for me, I moved to widget context and it was all a breeze.
Just what I needed. Thank you for posting.
Custom widgets is the only one that does exactly what I tell it to do, without fail.
Many thanks – Widget Logic was exactly what I was looking for (and the NZ summary you linked to had an example that covered my need perfectly).
This has saved me a few grey hairs!
Brilliant, big thanks indeed for that. Widget management has often been a pain in the proverbial so I’m more than pleased that you’ve given me some simplified options.
awesome job here, you helped me find exactly what I knew existed some where, just had not idea where!! Nice