Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function grandchild_level_list_pages() {
- global $post;
- $pages_tree = array_reverse(get_post_ancestors($post->ID));
- $pages_tree = array_merge($pages_tree, array($post->ID));
- if(is_page() && $pages_tree[1]) :
- $this_page = $pages_tree[1];
- // a condition that shows this list in the ancestry of the current page
- $plist = wp_list_pages('title_li=&child_of=' . $this_page .'&depth=1&echo=0');
- if(plist) { ?>
- <ul class="menu layer-grandchild">
- <?php echo $plist; ?>
- </ul>
- <?php }
- endif; //end if($pages_tree[1])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement