Widget Logic – A Quick Guide

Picture of B2B Bandits

B2B Bandits

Widget Logic – A Quick Guide

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.

Writing is easy. All you do is stare at a blank sheet of paper until drops of blood form on your forehead.

Robert Greena’s 6th strategy of War state

Digging these strategies?

Get them delivered to your inbox weekly.

READ MORE

Genuinely Curious

by B2B BanditsDecember 29, 2017

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

Story Worthy

by SBTNovember 26, 2017

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

Emotional Injury

by SBTApril 2, 2017

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

by SBTMarch 6, 2017

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

Nostalgic Revolution

by B2B BanditsFebruary 1, 2017

I wrote the below ramble a few months after moving to Chico, California. It took me 3-years to do something...

Tangible Reinforcement

by SBTJanuary 19, 2017

Confession time. I'm a resolutions addict. It all started in Murrieta, California. My mom had just achieved three gigantic milestones. After...