<?php

/* *****************
** WORDPRESS MENU **
****************** */
if (function_exists('register_nav_menus')) {
    register_nav_menus(
        array(
            'menu' => 'Primary menu',
            'footer' => 'Footer menu'
        )
    );
}
// remove container wp_nav
function my_wp_nav_menu_args($args = '')
{
    $args['container'] = false;
    return $args;
}
add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args');

// add wrapper for submenu
class WPSE_78121_Sublevel_Walker extends Walker_Nav_Menu
{
    function start_lvl(&$output, $depth = 0, $args = array())
    {
        $indent = str_repeat("\t", $depth);
        $output .= "\n$indent<div class='sub-menu-wrap'>
    <ul class='sub-menu'>\n";
    }
    function end_lvl(&$output, $depth = 0, $args = array())
    {
        $indent = str_repeat("\t", $depth);
        $output .= "$indent</ul>
</div>\n";
    }
}


add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args');
// add wrapper for submenu
class WPSE_new_header_Walker extends Walker_Nav_Menu
{

    function start_lvl(&$output, $depth = 0, $args = array())
    {

        $indent = str_repeat("\t", $depth);
        $output .= "\n$indent<div class='sub-menu-wrap'>
    <ul class='sub-menu'>\n";
    }

    function end_lvl(&$output, $depth = 0, $args = array())
    {
        $indent = str_repeat("\t", $depth);
        $output .= "$indent</ul>
</div>\n";
    }
}
