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 have an HTML/CSS template having a horizontal menu. I need to convert the template into a WordPress theme. I am stuck with the menu. I have used the wp_nav_menu function in my header.php file and have also completed the functions.php file. The menu is now displaying vertically with bullets. I need to implement the menu now, but am unable to find and associate the proper css class to the menu_class parameter. Kindly assist.

Thanks and Regards

Debashis

share|improve this question

1 Answer 1

Just look at wp_nav_menu arguments:

<?php

$defaults = array(
    'theme_location'  => '',
    'menu'            => '',
    'container'       => 'div',
    'container_class' => '',
    'container_id'    => '',
    'menu_class'      => 'menu',
    'menu_id'         => '',
    'echo'            => true,
    'fallback_cb'     => 'wp_page_menu',
    'before'          => '',
    'after'           => '',
    'link_before'     => '',
    'link_after'      => '',
    'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    'depth'           => 0,
    'walker'          => ''
);

wp_nav_menu( $defaults );

?>

You can use menu_id argument to set its id attribute and menu_class to set its class attribute. You can set containers id/class attributes as well.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.