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

Let's say I have a menu like this..

 -- rice
 -- apple
 -- sushi
 -- soccer
 -- basketball
 -- football
 -- red
 -- blue
 -- black

When I am on sushi page, I need to get like this.. (like breadcrumb)

Food > sushi

Current menu name and upper level menu name (if there is)

And when I put mouse on sushi, it will be a dropdown menu showing same depth level menus "rice, apple, sushi"

I may be able to working on the dropdown script but I don't know how to get these menu names and links.

Please let me know if you have any idea.

share|improve this question
up vote 0 down vote accepted

Sorry, this is a little vague but it should get you started. It seems like you need to:

  1. Check if the page has a parent <?php if($post->post_parent) ?>
  2. Something like <?php echo $post->post_parent; ?>
  3. Something like <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
  4. Something like the code below, then apply your solution for turning it into a dropdown.

There is more info here: http://codex.wordpress.org/Function_Reference/wp_list_pages

  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  if ($children) { ?>
  <?php echo $children; ?>
  <?php } ?>
share|improve this answer
I don't know why.. It doesn't work for me. Do I have to make pages hierarchy? parents pages and child pages? it doesn't showing. anyway thanks for your time and let me know if you have any idea. – pulla Sep 13 '13 at 2:58

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.