Support » Plugin: Widget Logic » [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?


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