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.

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

Home
Food
 -- rice
 -- apple
 -- sushi
Sports
 -- soccer
 -- basketball
 -- football
Color
 -- 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

1 Answer 1

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

<?php
  $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  if ($children) { ?>
  <ul>
  <?php echo $children; ?>
  </ul>
  <?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

 
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.