How to change wp_nav_menu walker or any other argument by filter in wordpress

For change wp_nav_menu argument for specific menu or all menu or change walker class for menu
just copy and paste below code into your theme's functions.php file and change menu slug as per your need


add_filter('wp_nav_menu_args','rj_change_walker_for_footer_menus',10,1);
function rj_change_walker_for_footer_menus($args)
{
    global $wpdb;
    if($args['menu']!='' && in_array($args['menu']->slug,array('footer-menu1','footer-menu2','footer-menu3')))
    {
        $args['fallback_cb']           = 'RJFusionFootermenuWalker::fallback';
            $args['walker']    =new RJFusionFootermenuWalker();
    }
    return $args;
}

Comments

Popular posts from this blog

How to add image option in nav menu in wordpress

How to add a custom email functionality in woocommerce,wordpress for example new email template for shipping order

How to change user id on checkout page for assign order to different user in woocommerce wordpress