find absolute parent of a page hierarchy
-
I created a menu using get_pages() and specifying the parent id. This parent id has children and sub-children and sub-subchildren. I need each of these (sub)children to have the parent id displayed .
The code i made ony works for children, not for sub/ sub-sub children
$pages = get_pages('child_of=16&parent=16&sort_column=menu_order&sort_order=asc&title_li=&exclude=73'); foreach($pages as $page) { <li <?php echo ($post->ID == $page->ID)? 'class="current_page_item"': ''; ?>><a>ID) ?>"><?php echo $page->post_title ?></a> <?php } ?>
I’m a bit puzzled on how to achieve that in wordrpress. Any suggestion is welcomed!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘find absolute parent of a page hierarchy’ is closed to new replies.