Add submenu to Wordpress theme

inhamesaimi

New Member
I want to add a submenu of a wordpress menu into my theme. I want to use the wp_nav_menu function of Wordpress 3.0. And in other words, I want to see the submenu not the subpages which means that wp_list_pages is not the right function because I want the submenu and not the subpages. Let's assume the menu structure looks like that:
  • Home
  • Entry1
    • Entry3
    • Entry4
  • Entry2
    • Entry5
    • Entry6
I want that if someone clicks on Entry1 (and makes it the parent) the Theme just shows the submenu of this entry. In the case of Entry1 it's:
  • Entry3
  • Entry4
I know that there is a code like that:\[code\]<?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>'); } ?> \[/code\]However, the point is that I'm talking about the menu structure and not the page structure. Oh, and the depth parameter does not work because it means to here and not from here. I think there could be a solution with a custom walker but I don't know how to implement that.Function reference for wp_nav_menuhttp://codex.wordpress.org/Template_Tags/wp_nav_menuI'm looking for a solution for this problem for so long so please help me. Thanks a lot.
 
Back
Top