WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Excluding a page (8 posts)

  1. theblogmaven
    Member
    Posted 2 years ago #

    What is the string to show the widget on the whole site *except* a certain page?

    Thanks!

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

  3. QD123
    Member
    Posted 2 years ago #

    Hello there,

    I got one exception to work using:

    !is_page('Selling')

    but how do I get two exceptions to work.... I tried

    !is_page('Selling', 'Buying')... but I am not a programmer so it didn't work.

  4. theblogmaven
    Member
    Posted 2 years ago #

    @alanft - is that something that works for posts too? I'm trying to make a widget show for everything except a specific post now...and it doesn't seem to be working.

  5. CBKat
    Member
    Posted 2 years ago #

    I could have sworn on an old site of mine (now deleted) that I was able to put:

    !is_page('427','785','532')

    and this would work for the pages that matched the ID #, however, it is not working and I too am looking for a way to do this.

  6. CBKat
    Member
    Posted 2 years ago #

    Hey, I figured it out by viewing: http://codex.wordpress.org/Conditional_Tags

    is_page( array( 42, 'about-me', 'About Me And Joe' ) )
    Returns true when the Pages displayed is either post ID = 42, or post_name is "about-me", or post_title is "About Me And Joe".
    is_page( array( 42, 54, 6 ) )
    Returns true when the Pages displayed is either post ID = 42, or post ID = 54, or post ID = 6.

    Just make sure you put the ! before the "is_page" otherwise it won't work

    So, for you, you should be able to put:

    !is_page( array( 'buying', 'selling' ) )

  7. QD123
    Member
    Posted 2 years ago #

    Thanks SOHKat,

    You da man!

  8. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    @theblogmaven

    http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page

    eg !is_single( '17' ) or !is_single( 'beef-stew') would work

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.