Can I get all user-created menus at once? (2 posts)

  1. johnrork
    Posted 6 years ago #

    Is there a way I can get all the available user-created menus at once rather than calling them each by individual name or id?

  2. johnrork
    Posted 6 years ago #

    Anything patently stupid about doing it this way?

    $menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
    foreach ( $menus as $menu ):
    	<ul class="menu-class">
      		<a href="#" class="menu-title"><?php echo $menu->name; ?></a>
    		<?php wp_nav_menu(array('menu' => $menu));?>
    <?php endforeach; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic