<?php


	// PRIMARY MENU
	 register_nav_menu( 'primary',  __( 'Primary Menu', 'themelang' ) );
  	 function menu_primary_display() {
		 
		  if(wp_is_mobile()){
			  
			  $primary_args = array (
			 'theme_location' => 'primary',
			 'container_class' => 'menu-mobile-container',
			 'menu_class' => 'menus menu-mobile',
			  'depth'           => 0,
			  'link_after' => '<i class="fa fa-angle-down" aria-hidden="true"></i>',
			 );
		  } else {
					
			 $primary_args = array (
			 'theme_location' => 'primary',
			  'menu_class' => 'menus menu-primary',
			  'container_class' => 'menu-primary-container clearfix',
			  'depth'  => 0,
			   'link_before' => '<span>',
			   'link_after' => '</span>',
			 );
		  }
      
      	wp_nav_menu($primary_args);
            
       }

//////////BOTTOM MENU////////////	
 register_nav_menu( 'bottom',  __( 'Bottom Menu', 'themelang' ) );
  	 function menu_bottom_display() {
			
			 $bottom_args = array (
			 'theme_location' => 'bottom',
			 'container_class' => 'menu-bottom-container clearfix',
			 'menu_class' => 'menu-bottom',
			  'depth'           => 1,
			 );
		
      
      	wp_nav_menu($bottom_args);
            
       }
	   
	   
/////////member MENU////////////	
 register_nav_menu( 'member',  __( 'Members Menu', 'themelang' ) );
  	 function menu_member_display() {
			
			 $member_args = array (
			 'theme_location' => 'member',
			 'container_class' => 'menu-member-container clearfix',
			 'menu_class' => 'menu-member',
			  'depth'           => 1,
			 );
		
      
      	wp_nav_menu($member_args);
            
       }
	   
	   
	   
// lang MENU
	 register_nav_menu( 'langswitch',  __( 'Language Menu', 'themelang' ) );
  	
		 function menu_langswitch_display() {
			 
			  $lang_args = array (
			 'theme_location' => 'langswitch',
			 'container_class' => 'menu-lang-container',
			 'menu_class' => 'menu-lang',
			
			 );
      
      	wp_nav_menu($lang_args);
            
       }
	   
	
	   
	   
// top MENU
	 register_nav_menu( 'top',  __( 'Top Menu', 'themelang' ) );
  	
		 function menu_top_display() {
			 
			   if(wp_is_mobile()){
			 $top_args = array (
			 'theme_location' => 'top',
			 'container_class' => 'topmenu-mobile',
			 'menu_class' => 'top-mobile',
			
			 );
			   } else {
				    $top_args = array (
			 'theme_location' => 'top',
			 'container_class' => 'topmenu',
			 'menu_class' => 'menus  topm',
			
			 );
			   }
      
      	wp_nav_menu($top_args);
            
       }


////////ADD MENU LEVEL CLASSES //////////

function change_ul_item_classes_in_nav( $classes, $args, $depth ) {
    if ( 0 == $depth ) {
        $classes[] = 'sub-level-1';
    }
    if ( 1 == $depth ) {
        $classes[] = 'sub-level-2';
    }
    // ...
    return $classes;
}
add_filter( 'nav_menu_submenu_css_class', 'change_ul_item_classes_in_nav', 10, 3 );


