WordPress.org

Forums

Exclude Child Pages With 'wp_nav_menu' - Primary Menu (6 posts)

  1. matius
    Member
    Posted 4 years ago #

    Have an issue where I don't want child pages showing in my primary menu. When I include them they appear like a dropdown menu when I roll over the particular parent page...

    If I don't include them though, they won't appear in the Flexi widget pulldown menu that I need them only to appear in.

    Is there a way with wp_nav_menu to exclude child pages?

  2. matius
    Member
    Posted 4 years ago #

    In my theme ... TwentyTen

    Updating the following in the CSS seems to do the trick:

    #access ul li:hover > ul {
       /* display: block; */
       display: none;
    }
  3. mikelite
    Member
    Posted 4 years ago #

    matius, I'm trying to do the same thing in the same theme. Where can I find this bit of code to update?

  4. authentictech
    Member
    Posted 4 years ago #

    mikelite, you can find this code in wp-content/themes/twentyten/style.css on line 430.

    It is better to make a child theme and edit the CSS there, however.

  5. authentictech
    Member
    Posted 4 years ago #

    matius, did you find a solution?

    You may be able to write another CSS rule specifically targeting the Flexi widget pulldown menu that re-applies the display:block.

  6. mikelite
    Member
    Posted 4 years ago #

    brilliant, thanks a lot authentictech

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.