Sample Widget Logic Codes

Author: Denny Brown Last modified on: October 6, 2018 11:05 pm
Share this post...

The Widget Logic plugin enables you to place widgets on some pages but not others.

<more story about how it works>

Here are some examples:

For xs.com

Company Menu

global $post; return (is_page('company') || in_array(69,get_post_ancestors($post)));

XS Administration menu

global $post; return (is_page('xs-administration') || in_array(2186,get_post_ancestors($post)));

XWS Dev menu

global $post; return (is_page('xws-development-resources') || in_array(2077,get_post_ancestors($post)));

For nlpco.com

What is NLP? sidebar widget. Only on the front page and the “What is NLP?” page.

is_front_page() || is_page('what-is-nlp')

Leave a Reply