Show Different WP Widgets On Different Posts or Pages – Widget Logic

wordpress logoWidget 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:


widget-logic-1Primarily 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()

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.  

Get The Inside Scoop!
social tripletKeep up with all the latest social marketing changes!

After Post Widget

This is where you can place your after content optin

Relevant Posts

This is the widget for relevant posts

Leave a Reply

9 Comments on "Show Different WP Widgets On Different Posts or Pages – Widget Logic"

1 year 5 months ago

Hi Kim,

This is really cool, I really had no idea that you could show different widgets on different posts with this plugin.

On Woo themes which is the theme that I am using it allows you to create different sidebars that you want to show on different posts and pages.

It takes some time to implement the different sidebars. Using the WP Widget Logic plugin seems quicker. I will definitely have to give it a try…thanks for sharing, have a great day.

1 year 5 months ago

Kim this is awesome! It just goes to show how flexible WP can be, I love the fact you show different widgets on different posts. I will be checking this out :)

1 year 5 months ago

Hi Kim, just thinking about the difference between widget logic and “dynamic widgets”. I had a quick look at the logic conditions you can use, and with “widget logic”, you can specify different “single posts” where you want/don’t want a widget to be displayed. That’s something “dynamic widgets” doesn’t allow you to do. I understand the “code” can put some people off though.

1 year 5 months ago

Hi Kim,

Thank you very much for this post. I am interested in having more control of the widgets.

Writing a piece of code is not scary and I will check the WordPress conditional tags. Everything depends on how easy the syntax is. However, I will certainly take a look at the other widget to see if it really simplifies the work.

Another great idea and another piece of valuable and useful information. Thank you.

Have a wonderful day

1 year 5 months ago

Okay so the very word “code” just makes my eyes glaze over, but I love, LOVE the idea of being able to get more creative with widgets so I’m definitely going to take a close look at this. I also think I’m going to finally break down and take that basic code writing class at our local college because I’m sick of being intimidated by this stuff. :-)