I have basic navigation and all parents have children. For instance:
Page A: About Us child1 child2 Page B : Our services Child 3 Child 4
I need to enable the horizontal submenu on the page. But my problem is that if we are currently on page A, all the children of page A will only be displayed on page. If we are on page A, it should look like this:
Page A
Child 1
Child 2
Similarly, when we go to page B, the child of page B should only be displayed.
<?php $args = array( 'theme_location' => '', 'menu' => '13', //nav menu id, which has about-us as a menu. 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'depth' => 0, 'walker' => '' ); $menu_items = wp_nav_menu($args);//wp_get_nav_menu_items(13);
I tried to write the above code, resulting in all the parent elements with their children.
Can someone help me with this?
In short, I want to get all the children (submenus) in the About Us menu (for example, I want child1 and child2 to be in a list with <a>
tags)