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.

Picture of B2B Bandits

B2B Bandits

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

Robert Greene’s 6th Strategy of War States.

Digging these strategies?

Get them delivered to your inbox weekly.

READ MORE

The Split Attention Strategy

by B2B BanditsFebruary 21, 2025

Unconventional B2B Strategy #17 1775. Boston lay in the grip of the world's mightiest empire. British authority seemed absolute. Most...

The Gen Z General

by B2B BanditsFebruary 14, 2025

Unconventional B2B Strategy #16 216 BC. Rome was bleeding. North African general Hannibal Barca just obliterated 50,000 Roman soldiers at...

Control the Dynamic

by B2B BanditsFebruary 6, 2025

Unconventional B2B Strategy #15 1941. North Africa. General Wavell finally gained the upper hand against the Germans. The British general...

The Blitz

by B2B BanditsJanuary 31, 2025

Unconventional B2B Strategy #14 1818. South Africa. The 12,000-strong Ndwandwe army emerges from the morning mist. Shaka waits with his...

Ethical Espionage

by B2B BanditsJanuary 24, 2025

Unconventional B2B Strategy #13 1942. Lisbon. Juan Pujol writes another coded message for the Nazis. English troop movements. Air defenses....

Lose to Win

by B2B BanditsJanuary 17, 2025

Unconventional B2B Strategy #12 333 B.C. A young king from Greece had just crushed Persia’s forces in Turkey - his...