• Hi,

    Could someone correct this widget logic filter as it doesn’t seem to working for me?

    !( is_page(array(5,47,108)) || in_array($post->post_parent, array(5,47,108)) )

    I’m trying to hide a widget from pages, 5,47,108 and there descendants.
    It’s hiding it ok on the top level pages but not the child pages.

    Any ideas?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • you need

    global $post;

    at the beginning

    Thread Starter ryanoryan

    (@ryanoryan)

    Apologies, only coming back to this now.

    It now reads:

    global $post; !( is_page(array(5,47,108)) || in_array($post->post_parent, array(5,47,108)) )

    But the menu as not working on any page.

    Any ideas?

    Thanks

    Thread Starter ryanoryan

    (@ryanoryan)

    Fixed it, may be of use to someone else:

    global $post; return !( is_page(array(5,47,108)) || in_array($post->post_parent, array(5,47,108)) ) ;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Widget Logic Help’ is closed to new replies.