Hi all,
I have been asked to set up a wordpress site, and are finding it hard to find in the documentation how I can do the folllowing:
A main link is clicked, and only then I want to show the children underneath, if there is any.
Further if a child link is clicked, I want to show the children underneath, if any.. So recursively displaying children.
Im not interested in showing the entire tree at one time, only the children, when a parent is clicked.
I have this small bit of code, showing the main menu (Stacked on top of each other in a left bar on the site)
<div id="sidebar_main_nav">
<?php
// Main navigation
$defaults = array(
'container' => 'div',
'container_class' => '',
'container_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'theme_location' => 'primary',
'menu_class' => 'main_nav',
'menu_id' => '',
'link_before' => '',
'depth' => 1);
wp_nav_menu( $defaults );
?>
</div>
This spits out the main links.
I guess I need to loop some native wordpress functions in some way?
Any help appreciated,
Regards, Klemme