Forums

Equivalent to in_category for pages? (4 posts)

  1. sdiggles
    Member
    Posted 10 months ago #

    So I am trying to figure out how to use a condition that would be the equivalent for categories in_category.

    If you are wondering why- I set up a business resource page and then made all US states sub pages but now I want to list all the subpages when you are on those pages and it's parent...I can do that with:

    <?php wp_list_pages('child_of=682&sort_column=post_title&title_li=') ?>

    The problem I have is I don't want my other widgets showing up on that side, so I would like an easy way to set a conditional similar to this, but for pages:

    <?php if (!in_category('682')) : ?>

    So to recap:

      I want to show the pages on the sidebar when in that page and it's children
      I don't want to show it anywhere else (no problem)
      I don't want my other widgets to show on the page or it's children (can't figure out)

    I am aware that I can exclude_pages but I don't want to list out all the pages like (98,9282,9292,...etc etc...I also would like to know this for the future.

    Thanks for all the help!!!

  2. nsathees
    Member
    Posted 10 months ago #

    can't understand what you want! Can you write an example?

  3. esmi
    Theme Diva & Forum Moderator
    Posted 10 months ago #

  4. sdiggles
    Member
    Posted 10 months ago #

    So what would be the equivalent to a:

    exclude_pages(1,3,4,5,6,7,etc)...

    How would I write it as a conditional...

Reply

You must log in to post.

About this Topic