I want to add a Wordpress menu submenu to my theme. I want to use the wp_nav_menu function of Wordpress 3.0. In other words, I want to see a submenu, not a subpage, which means that wp_list_pages is not the right function, because I want a submenu, not a subpage.
Suppose the menu structure looks like this:
I want that if someone clicks on Entry1 (and makes him a parent), the topic simply shows a submenu of this entry. In the case of Entry1, this is:
I know there is a code like this:
<?php
$children = ($post->post_parent) ? wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0') : wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if($children) { echo('<ul>'.$children.'</ul>'); }
?>
However, the fact is that I'm talking about the structure of the menu, and not about the structure of the page. Oh, and the depth parameter doesn't work, because it means here, not from here.
I think there may be a solution with a custom walker, but I don't know how to implement this.
wp_nav_menu
http://codex.wordpress.org/Template_Tags/wp_nav_menu
, , , . .