treehouse : what would you like to learn today?
Web Design Web Development iOS Development

wp nav args

  • Most of the stuff I am taking from the codex for my nav doesn't seem to be working.

    <?php wp_nav_menu( array( 'container_class' => 'group' , 'items_wrap' => '%3$s' )); ?>
    

    It should be adding the class 'group' to the container as stated from the codex:

    $container_class (string) (optional) The class that is applied to the container

    It only gives the the class of menu still. Also, the last strand should remove the ul tag from the menu, which is not working either.

    I tried using 'menu_class' which works, but codex says that should only apply to the ul tag, so I can add the class group and menu, but then would need to target the ul to add the class group also.

    Any ideas?

  • Hi Jeager,

    From codex: http://codex.wordpress.org/Function_Reference/wp_nav_menu

    $items_wrap (string) (optional)

    Evaluated as the format string argument of a sprintf() expression. The format string incorporates the other parameters by numbered token. %1$s is expanded to the value of the 'menu_id' parameter, %2$s is expanded to the value of the 'menu_class' parameter, and %3$s is expanded to the value of the list items. If a numbered token is omitted from the format string, the related parameter is omitted from the menu markup.