WordPress.org

Ready to get started?Download WordPress

Forums

items_wrap ignoring custom values (1 post)

  1. Keep2theCode
    Member
    Posted 1 year ago #

    I'm trying to add a class to the ul for the primary nav menu. I have this in my functions file:

    function smpl_wp_nav_menu_args( $args = '' )
    {
    	$args['container'] = false;
    	$args['theme_location'] = 'primary';
    	$args['menu_class'] = 'menu clearfix';
    	$args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
    	echo '<pre>'; print_r($args); echo '</pre>';
    	return $args;
    }
    add_filter( 'wp_nav_menu_args', 'smpl_wp_nav_menu_args' );

    If I understand correctly, items_wrap is to get its "2" value from menu_class. I've also tried just putting the class directly into items_wrap. I even tried doing a simple change to an OL without any other arguments and it is still ignored. Help please?

Topic Closed

This topic has been closed to new replies.

About this Topic