WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Exclude all pages, except specific pages? (4 posts)

  1. CBKat
    Member
    Posted 2 years ago #

    I know to get widgets to show up on specific pages I put:

    !is_page( array( ID#, ID#, ID# ) )

    But how do I instead exclude pages? For example, I want some ads only on 3 out of 100 pages, so I don't want to put 100 ID's in there. Is there a way to do this? I thought it would be by using

    !is_single( array( ID#, ID#, ID# ) )

    But that is not working. Any suggestions, or is this not possible?

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

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    to exclude pages !is_page(array(X, Y, Z)) should work find. (I'm guessing the ! in your top line of code was an accident)

  3. CBKat
    Member
    Posted 2 years ago #

    No, it doesn't work unless I keep the "!"

    And I want to exclude all pages except for specific ones. With 100+ pages to exclude one by one that would be a mess. . .

  4. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    is_page(array(X, Y, Z))
    will make a widget appear on page X or page Y or page Z

    !is_page(array(X, Y, Z))
    will make a widget appear when it is none of the same pages

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.