Menu_id and menu_class will not work properly with wp_nav_menu(); (4 posts)

  1. Jonas
    Posted 3 years ago #

    According to wordpress.org - Function Reference/wp_nav_menu the menu_id and menu_class will give the ul an id and/or a class. For some reason it doesn't.


    <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_id' => 'nav', 'menu_class' => 'clearfix', 'show_home' => '1' ) ); ?>


    add_action( 'init', 'register_my_menu' );
    function register_my_menu() {
    register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );}

    The menu_class creates a div with the given classname and wraps it around the ul while the menu_id doesn't seem to have an effect at all. I want to give the ul an id and a class. In advance, thanks.

  2. Jonas
    Posted 3 years ago #

    I've solved it. Read this post if you have a similar problem.

  3. shahidkarimi
    Posted 3 years ago #

    Hey @Jonas, on visiting the link you posted there is no solution at all? Why you post the link if you did not read that post? Huh

  4. Digital Raindrops
    Posted 3 years ago #

    Why are you asking questions in a topic from 8 months ago, if you have a question start a new topic!

    There have been new releases in the last eight months with many issues resolved, so it is likly not a problem now!


Topic Closed

This topic has been closed to new replies.

About this Topic