Widget Logic Creates
Dynamic Widgets
Wouldn’t it be spiffy if you didn’t have to show all the same widgets to every single user?
What if you could hide membership related widgets from people not logged in? Or show subscription related widgets from people that were on pages they get to after subscribing? What about promoting an XYZ product in a widget only on posts in XYZ category?
Turns out you can!
Introducing: Widget Logic
& Dynamic Widgets
Conditional display for WordPress widgets!
Widget Logic adds a small text field to the bottom of every widget box to enable you to declare the conditional or functional expression to control when/if a widget displays on a certain page.
Widget Logic is proven, tested, stable and pretty much “industry standard”.
The only downside of Widget Logic is that you have to fill in a code snippet that… well… looks like code. But the possibilities for precise control are endless!
If however, you don’t mind having less specific control, but want to skip this code snippet idea, the plugin Dynamic Widgets is an offspring of that plugin that adds some of the options as simplified check-boxes.
Today I’m going to cover Widget Logic. However, Dynamic Widgets is VERY similar and if you want to take a closer look at it, see Julieanne’s post here.
Widget Logic
This free plugin has few settings of its own:
Primarily though, it adds a visibility field to the bottom of every single widget item in your sidebar (from the admin view).
Leave the visibility field blank to show all…. or fill it in with a conditional PHP or WordPress code statement, to get the desired effects.
Some examples include
is_user_logged_in()
is_home()
is_page()
! is_user_logged_in()
! is_home()
You can find more WordPress conditional tags - and Functional tags - here in the codex.
For example, you may only want a certain widget item to display on a certain blog post… you can do that with this!
You can download Widget Logic here or Dynamic Widgets here.
Simple, lightweight, effective… the perfect solution for this project and maybe for one of your projects too!
~ Kim ~
Simple Tech Tips For Marketing
PS: You can also use conditional expressions on menus and run different themes on different post/pages.