catchresponsive_mobile_menus

This function loads Mobile Menus.

Description

catchresponsive_mobile_menus(); 

Usage

  1. if ( !function_exists( 'catchresponsive_mobile_menus' ) ) { 
  2. require_once '/inc/catchresponsive-menus.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = catchresponsive_mobile_menus(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-menus.php  
  1. function catchresponsive_mobile_menus() { 
  2. //For primary menu, check if primary menu exists, if not, page menu 
  3. echo '<nav id="mobile-header-left-nav" class="mobile-menu" role="navigation">'; 
  4. if ( has_nav_menu( 'primary' ) ) { 
  5. $args = array( 
  6. 'theme_location' => 'primary',  
  7. 'container' => false,  
  8. 'items_wrap' => '<ul id="header-left-nav" class="menu">%3$s</ul>' 
  9. ); 
  10. wp_nav_menu( $args ); 
  11. else {  
  12. wp_page_menu( array( 'menu_class' => 'menu' ) ); 
  13. echo '</nav><!-- #mobile-header-left-nav -->'; 
  14.  
  15. //For Secondary Menu 
  16. if ( has_nav_menu( 'secondary' ) ) { 
  17. echo '<nav id="mobile-header-right-nav" class="mobile-menu" role="navigation">'; 
  18. $args = array( 
  19. 'theme_location' => 'secondary',  
  20. 'container' => false,  
  21. 'items_wrap' => '<ul id="header-right-nav" class="menu">%3$s</ul>' 
  22. ); 
  23. wp_nav_menu( $args ); 
  24. echo '</nav><!-- #mobile-header-right-nav -->';