supervee
Member
Posted 3 years ago #
I need to make a list of certain pages and their child pages. I see that in the codex page for ws_list_pages, there is a exclude_tree parameter, but there isn't an include_tree? Is there a way to do this without going through and listing every page I want to include? (or similarly, listing every page i want to exclude)
I tried this method and it seemed to work on the parent page, but when I clicked on the child page, it only displayed the child. I want a list (like the one below), consistently on every page.
I'm new to all this and still learning so thanks in advanced.
supervee
Member
Posted 3 years ago #
GreenMage
Member
Posted 3 years ago #
dougwaltman
Member
Posted 2 years ago #
I also am looking for this functionality. It doesn't make sense to have an "exclude_tree" option, and not an "include_tree" option.
Why was this topic marked as resolved? I see no resolution.
Yeah, I also am in need of this setup... and again, why is this set as resolved?
only the op can set it as resolved so I suppose they found an answer and didn't bother sharing
Add the is_tree(); function to your functions.php (or to the functions.php in the wp-functions folder):
REad here for links and info:
http://codex.wordpress.org/Conditional_Tags (scroll down to snippet4)
here's the function:
function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath
global $post; // load details about this page
if(is_page()&&($post->post_parent==$pid||is_page($pid)))
return true; // we're at the page or at a sub page
else
return false; // we're elsewhere
};
If that helps you, mark your post resolved...
msagacious
Member
Posted 2 years ago #
I also need this functionality.
I want a menu item with all its sub pages..
I cudnt find, why it has been marked "RESOLVED" ?
joesmalley
Member
Posted 2 years ago #
vangrog
Member
Posted 2 years ago #
@ joesmalley
that works nice... thx!