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;
}
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
Post a Comment