Widget Logic
Operators not working (2 posts)

  1. cdragin
    Posted 3 years ago #

    I am trying to keep a widget from showing up on any blog-related page, but to appear on all pages except for two. The code I have is
    !is_page( array( 'portfolio', 'branding' ) ) || !is_single() || !is_home()

    I have also tried
    is_page() && !is_page( array( 'portfolio', 'branding' ) )

    I can get any of the conditional tags to work by themselves, but do not seem to be able add others with operators.


  2. alanft
    Plugin Author

    Posted 3 years ago #

    first off see the FAQ for a 'gotcha' around using is_page…


    Then it sounds like your 2nd attempt *should* work. Try putting in the post IDs instead of names/slugs if you still can't get it right. If that doesn't work try a more basic 'all pages, but this one' logic like…

    is_page() && !is_page('portfolio')

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic