WordPress.org

Ready to get started?Download WordPress

Forums

Show children from parent when parent is clicked (2 posts)

  1. TryingMore
    Member
    Posted 1 year ago #

    Hello all,

    How can I "unfold" my parent to show all the children?
    How can I achieve this with wp_nav_menu();?

    • Parent1
    • Child1 from parent1 only showed when I clicked parent1
    • Child2 from parent1 only showed when I clicked parent1
    • Parent2
    • Child1 from parent2 only showed when I clicked parent2
    • Child2 from parent2 only showed when I clicked parent2

    etc.
    Thanks..

  2. Hristo SiteGround
    Member
    Posted 1 year ago #

    Hello,

    By default wp_nav_menu should be showing all levels of the menu. Please check your theme whether it does modify the number of layers shown. It should be something like this:

    <?php wp_nav_menu( array('depth' => '1' )); ?>

    If you locate such line, change the depth to 0 (zero) which will render all levels of the navigation.

Topic Closed

This topic has been closed to new replies.

About this Topic