WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 down vote accepted


<?php //get top level page ID;
$top = ( $post->post_parent ) ? array_pop(get_post_ancestors($post->ID)) : $post->ID;  
  echo '<ul>'; 
  echo '</ul>'; 
share|improve this answer

Your Answer


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.