Widget Logic – A Quick Guide

Picture of B2B Bandits

B2B Bandits

Widget Logic is a great way to selectively choose which widgets appear on which pages.  Very helpful for non-profits with sponsors whose contract is limited to certain services.

Here’s a screenshot of Widget Logic being used to limit a sponsor logo and text to a particular page: 

Here’s an overview from Widget Logic’s plugin page of some common phrases. (Full List Here)

  • is_home() — just the main blog page
  • !is_page( ‘about’ ) — everywhere EXCEPT this specific WP ‘page’
  • !is_user_logged_in() — shown when a user is not logged in
  • is_category( array(5,9,10,11) ) — category page of one of the given category IDs
  • is_single() && in_category( ‘baked-goods’ ) — single post that’s in the category with this slug

There are endless possibilities with what you can do with theses.  Widget Logic fully supports WordPress’ conditional tags.

IMPORTANT NOTES:

  1. Make sure you include a space between the parentheses and the single quotation mark.
  2. If using a categorical condition (to display a widget just on a certain blog category) you may need to to install the Reveal ID’s Free Plugin so you can see the Category ID numbers on the admin page.
  3. Keep it simple … if you find yourself adding dozen of widgets to customize your site, it is probably a sign that you may need a better WordPress theme that supports custom layouts and/or static content blocks such as Salutation

 

If you have any questions on this, scroll down and leave a comment or shoot me an email.

Digging these strategies?

Get them delivered to your inbox weekly.

READ MORE

Genuinely Curious

December 29, 2017 5 Min read

"This is just stupid!" I roared from inside my boss' windowless office. Thankfully no windows meant good acoustics for rage-Nate. Debra,...

Story Worthy

November 26, 2017 7 Min read

An ex-friend (we'll call him J) called me out of the blue today. I had a hard time remembering why...

Emotional Injury

April 2, 2017 3 Min read

Last month, I clocked just shy of two thousand miles driving zig-zagging all across California. House hunting. School hunting. Business hunting. Sanity hunting....

one problem

March 6, 2017 4 Min read

I've learned a lot from my TV addiction. I was a beta customer of Netflix during the red and white...