Adding a class to ul in custom wordpress menu

I am trying to add a class to the default ul generated in a custom wordpress menu.

I have created the custom menu in the backend and set it up fine, after referencing the wordpress codex this is the code I am currently using:

Read More
<?php 
if ( has_nav_menu( 'main-navigation' ) ) { /* if menu location 'main-navigation' exists then use custom menu */
  wp_nav_menu( 
    array(  
        'theme_location' => 'Main Navigation',
        'menu_class'      => 'row',
        'items_wrap' => '<ul class="nav">%3$s</ul>',
        'walker'         => '',
        ) 
    ); 
}
?>

This is generating a div with a class of “row” wrapping around my ul but no class is added to the ul itself. I have seen many people with this problem online but no solutions.

Thanks.

Related posts

Leave a Reply

3 comments