Install and active the Widget Logic plugin.

The Widget Logic plugin allows you to use Wordpress' conditional tags to specify if the widget should be shown or not.

Widget Logic gives us one field to work with. In it you can use Wordpress conditional tags or actual PHP code. This is a little more advanced and not recommended if you don't know what you are doing. Also, anyone with access to your dashboard will actually be able to run scripts through this box. This means they can run malicious code if they please.

Here are some of the things you can try out with this plugin.

  • Show on single post: is_single(1) - replace 1 with the post ID, slug or title
  • Show on every page except one: !is_page(2) - replace 2 with the page ID, slug or name. ! returns true when the statement is false. It's kind of like saying "is not page with the id of 2".
  • Show on single posts in the category calledCrazy Posts: is_single() && is_category('Crazy Posts') - && means and, you can also use|| which means or.

Well, I hope this training was enjoyable and more importantly helpful.



Join the Discussion
Write something…
Recent messages
emanda1964 Premium
they dont have the plugin for MAC?
Reply
onmyownterms Premium
Question for original poster who is no longer active.
Reply
thevaz74 Premium
Will do thanks!
Reply
thevaz74 Premium
The widgets were working fine until I tried to add a page and needed to move some things around. Now I can't get everything back where I want them, even when I set the widgets as described above. Do you think I need to delete and re-create the widgets?
Reply
Sielke Premium
I'm not sure what the problem is exactly. If you want you can PM me the details and I can take a look.
Reply
nathaniell Premium
I didn't even know this was possible. Easy to do and can make a blog more efficient. Thanks.
Reply
Sielke Premium
Definitely, there's a lot of plugins out there that do pretty much anything you'd ever want.
Reply
thevaz74 Premium
Thanks so much for doing this tutorial! I went with "The Simple Way" because I'm still learning. I followed your instructions and I was able to put my widgets only on the pages I wanted them on. Thanks again!
Reply
Sielke Premium
I'm glad it helped someone! Comments like that make me happy and willing to contribute.
Reply
Top