WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_nav_menu() not removing container as instructed (6 posts)

  1. datdesignguy
    Member
    Posted 2 years ago #

    Hi guys,

    I'm trying to set up superfish in a custom theme I am developing. To get this to work properly I need to remove the wrapping <div> from the wp_nav_menu function's output.

    Here is my code:

    http://pastebin.com/YQnwV3VF

    Any ideas here?

    I consulted the codex entry for wp_nav_menu() and I can't find anything wrong with this code. No matter what I try though, it still outputs the menu with a <div> wrapper.

    Any ideas?

  2. JarretC
    Member
    Posted 2 years ago #

    Try adding a space before the false on container.

  3. datdesignguy
    Member
    Posted 2 years ago #

    No dice :( Still doesn't have any effect.

  4. JarretC
    Member
    Posted 2 years ago #

    Did you see the 'Removing the Navigation Container' section on http://codex.wordpress.org/Function_Reference/wp_nav_menu

    It states you can either set it up in functions.php or to try

    `<?php wp_nav_menu( array( 'container' => '' ) ); ?>

  5. datdesignguy
    Member
    Posted 2 years ago #

    I figured out what the "problem" was. Me. LOL.

    Guys, when you're attempting to override the default arguments for wp_nav_menu... make sure you've assigned a menu to the theme location before you try and test out your code!

    *facepalm*

    Jarret, thanks for convincing me to take another long, hard look at the codex. If it weren't for your suggestion, I probably would've sat stumped for another couple hours. No kidding. GAH! lol

  6. JarretC
    Member
    Posted 2 years ago #

    It happens, you can't be a developer without little nuances like that ;)

Topic Closed

This topic has been closed to new replies.

About this Topic