Title: [Plugin: Widget Logic] conditional statement help
Last modified: August 19, 2016

---

# [Plugin: Widget Logic] conditional statement help

 *  [willie_dixon](https://wordpress.org/support/users/willie_dixon/)
 * (@willie_dixon)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-widget-logic-conditional-statement-help/)
 * Here’s what I have
 * global $post; return is_page(7) || ($post->post_parent==”7″) || in_array(‘7’,
   $post->ancestors);
 * which includes the widget on a page and all children/grandchildren.
 * This works except on the posts page. I have a static homepage and the post page
   is called “News”. The widget works as intended but it shows up on my News page
   as an array error message. It doesn’t show up on individual post pages.
 * I have tried this:
 * global $post; return is_page(7) || ($post->post_parent==”7″) || in_array(‘7’,
   $post->ancestors) || is_page(75);
 * where 75 is the page ID for the News page. I have also tried a few other things
   but can’t get the widget to NOT appear on the News page.
 * Anyone have input as to how I can exclude the News page?
 * Thanks.

The topic ‘[Plugin: Widget Logic] conditional statement help’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [willie_dixon](https://wordpress.org/support/users/willie_dixon/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-widget-logic-conditional-statement-help/)
 * Status: not resolved