0

I'm trying to figure out how to do, Second Level Menu as a template function, that persistent when visiting any level, whether its a top level page, or a grand children Page. Any Ideas?

2
  • is that for pages only? i.e. could the menu be made with wp_list_pages()?
    – Michael
    Commented Jun 29, 2011 at 19:59
  • Yeah..it'll be fore pages...i'll have to look into that function, never used it before...
    – Wok
    Commented Jun 30, 2011 at 1:07

1 Answer 1

1

example:

<?php //get top level page ID;
$top = ( $post->post_parent ) ? array_pop(get_post_ancestors($post->ID)) : $post->ID;  
  echo '<ul>'; 
    wp_list_pages('title_li=&child_of='.$top.'&depth=1'); 
  echo '</ul>'; 
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.