Equivalent to in_category for pages?
-
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!!!
- The topic ‘Equivalent to in_category for pages?’ is closed to new replies.