Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to edit the default arguments in the wp_nav_menu function. Basically I need to add a custom class to the UL and a custom class to the LI.

I have tried to use

<?php
function my_wp_nav_menu_args( $args = '' )
{
    $args['menu_class'] = "test";
    return $args;
} // function

add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
?>

This added a test to the div outside.I tried to edit

'items_wrap' => '%3$s',

no luck.

share|improve this question
1  
Haven't you tried custom class mentioned in THIS built-in function? –  Mayeenul Islam Jul 5 '13 at 20:15
    
which one specifically? –  user31344 Jul 5 '13 at 20:26
    
$menu_class & 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>'? –  Mayeenul Islam Jul 5 '13 at 20:32
    
yeah I tried that no dice, I am using a walker class and that seems to be doing it right. It's not explained very well, but apparantly you set up a walker class in the functions.php and then call that in your template. –  user31344 Jul 5 '13 at 20:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.