WordPress.org

Ready to get started?Download WordPress

Forums

How to pull out the sub menu items and use in theme. (10 posts)

  1. drbigfresh
    Member
    Posted 2 years ago #

    So I've seen this asked a bunch here and there, this ones seems to be the exact problem I'm having:
    http://wordpress.org/support/topic/add-submenu-subnavigation-to-wordpress-theme

    But like every other response I've seen, the solution doesn't work.

    But basically, this is what I want to do:
    Let's assume the menu structure looks like that:

    - Home
    - Entry1
    -- Entry3
    -- Entry4
    - Entry2
    -- Entry5
    -- Entry6

    I want that if someone clicks on Entry1 (and makes it the parent) the Theme just shows the submenu of this entry. In the case of Entry1 it's:

    - Entry3
    - Entry4

    But this isn't selecting the child pages, this all needs to come from the menu builder, so it's selecting the child menu items.

    I'd think there was an easy way to do this, but Google is hinting that perhaps it's not that easy.... Anyone have any ideas?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. drbigfresh
    Member
    Posted 2 years ago #

    Yeah, I've got all that working. What I can' figure out how to do in my theme is to pull out the submenu items when on the appropriate page. Something like this:
    https://img.skitch.com/20120316-h6gkhggit863cdmkgchtp1wbf.jpg

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Are these dropdowm menus or what?

  5. drbigfresh
    Member
    Posted 2 years ago #

    No, it's just displaying as an unordered list a few divs away from the top main menu. (assuming that you're on the parent menu item, or one of the children menu items)

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    No - are you trying to achieve a dropdown menu or something else entirely?

  7. drbigfresh
    Member
    Posted 2 years ago #

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    So a separate sub-menu, yes? That's the kind of detail we really need. Are these static Pages or Categories?

  9. drbigfresh
    Member
    Posted 2 years ago #

    Oh yes, sorry. Yes, it's a separate sub-menu. They are a mix of static pages, and custom menu items. The Custom ones are links to things that are not within wordpress...but I could convert those to pages as well if it makes generating the menu easier.

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    Mixtures of post-types are always bad to try and code for. Making them all static Pages with a direct Parent-Child relationship would make your life way easier. See List_Sub-Pages for a couple of different solutions.

Topic Closed

This topic has been closed to new replies.

About this Topic