WordPress.org

Ready to get started?Download WordPress

Forums

WP theme dev menu question (3 posts)

  1. Yaeko
    Member
    Posted 3 years ago #

    Hi!

    It's a long time ago that I themed a WP theme so I've forgotten a lot of things :(.

    I want to style a menu with my own id and classes.
    so I call the menu function wp_nav_menu and I see that this is wrapped in a div, but I don't want this, how can I remove the div?

    Thanks!

  2. Yaeko
    Member
    Posted 3 years ago #

    I tried to use this:

    <?php
    
                    $nav_args= array(
                        'menu'                => '',
                        'container'            => '',
                        'menu_class'        => 'horizontal-list clearfix',
                        'menu_id'            => 'nav',
                        'echo'                => true,
                        'theme_location'    => 'index'
                    );
    
                ?>
                <?php wp_nav_menu( $nav_args ); ?>

    But it doesn't work, anyone knows why?

  3. esmi
    Forum Moderator
    Posted 3 years ago #

    Short answer: You can't. Although the Codex documentation implies that it's possible to remove or change the container, it's not currently possible.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags