Hiding parents AND it’s children.
I’m looking for some help in trying to hide the a parent PAGES, that has children PAGES.
I’ve been spending hours experimenting with wp_pages_list();, and the exclude/include parameters. However the main disadvantage over those, is I would have to enter every ID that I wanted to be excluded or included.
The reason I’m looking to perform this action is to just show and hide a parent page with all it’s child pages, on my web site, in different areas of the website. I don’t want all the pages showing, just selective ones to represent different sections.
I know the concept, just not sure how to do it:
1. Grab the parent page ID
2. Loop and grab all the children pages ID’s of that parent page ID
3. Display parent page ID, followed by children of that parent page ID underneath only.
Any ideas please?
- The topic ‘Hiding parents AND it’s children.’ is closed to new replies.