예제 #1
0
 function avada_main_menu()
 {
     wp_nav_menu(array('theme_location' => 'main_navigation', 'depth' => 5, 'menu_class' => 'fusion-menu', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'fallback_cb' => 'FusionCoreFrontendWalker::fallback', 'walker' => new FusionCoreFrontendWalker(), 'container_class' => 'fusion-main-menu'));
     if (has_nav_menu('sticky_navigation') && (!function_exists('ubermenu_get_menu_instance_by_theme_location') || function_exists('ubermenu_get_menu_instance_by_theme_location') && !ubermenu_get_menu_instance_by_theme_location('sticky_navigation'))) {
         wp_nav_menu(array('theme_location' => 'sticky_navigation', 'depth' => 5, 'menu_class' => 'fusion-menu', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'fallback_cb' => 'FusionCoreFrontendWalker::fallback', 'walker' => new FusionCoreFrontendWalker(), 'container_class' => 'fusion-main-menu fusion-sticky-menu'));
     }
     // Make sure mobile menu is not loaded when ubermenu is used
     if (!function_exists('ubermenu_get_menu_instance_by_theme_location') || function_exists('ubermenu_get_menu_instance_by_theme_location') && !ubermenu_get_menu_instance_by_theme_location('main_navigation')) {
         avada_mobile_main_menu();
     }
 }
예제 #2
0
 function avada_main_menu($flyout_menu = false)
 {
     $sticky_menu = '';
     $main_menu_args = array('theme_location' => 'main_navigation', 'depth' => 5, 'menu_class' => 'fusion-menu', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'fallback_cb' => 'FusionCoreFrontendWalker::fallback', 'walker' => new FusionCoreFrontendWalker(), 'container_class' => 'fusion-main-menu', 'container' => 'div');
     if ($flyout_menu) {
         $flyout_menu_args = array('depth' => 1, 'container' => false, 'echo' => false);
         $main_menu_args = wp_parse_args($flyout_menu_args, $main_menu_args);
         $main_menu = wp_nav_menu($main_menu_args);
         return $main_menu;
     } else {
         wp_nav_menu($main_menu_args);
         if (has_nav_menu('sticky_navigation') && (!function_exists('ubermenu_get_menu_instance_by_theme_location') || function_exists('ubermenu_get_menu_instance_by_theme_location') && !ubermenu_get_menu_instance_by_theme_location('sticky_navigation'))) {
             $sticky_menu_args = array('theme_location' => 'sticky_navigation', 'container_class' => 'fusion-main-menu fusion-sticky-menu', 'menu_id' => 'menu-main-menu-1');
             $sticky_menu_args = wp_parse_args($sticky_menu_args, $main_menu_args);
             wp_nav_menu($sticky_menu_args);
         }
         // Make sure mobile menu is not loaded when we use slideout menu or ubermenu
         if (!function_exists('ubermenu_get_menu_instance_by_theme_location') || function_exists('ubermenu_get_menu_instance_by_theme_location') && !ubermenu_get_menu_instance_by_theme_location('main_navigation')) {
             avada_mobile_main_menu();
         }
     }
 }