Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
I have something like this
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
echo $children;
‘child_of’ will also get descendants of children;
try to work with ‘parent’ to get only direct children.
http://codex.wordpress.org/Function_Reference/get_pages#Parameters
if this is not it, please post more specific details about ‘gives me all kind of pages’
alchymyth,
i tried both ‘child_of’ and ‘parent’. First I made sure that I actually get the right id, and that is correct (in my case 466)
The page I want to get children for is level 1 (child of the root level page), which makes its children level 2 pages
‘child_of’ gives me all the root level pages and their sub pages on the level 1
‘parent’ is even more confusing for all I get is 3 pages from level 0 (there are much more pages at the root). Tried ‘child_of’ in conjunction with ‘parent’ feeding same id – same result!
Makes sense?
Thank you so much for trying to help! Right now I am using plain text links hard coded in the template (so lame lol)