Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

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

1 Answer 1

up vote 1 down vote accepted

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>'; 
?>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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