Forums

Submenu like the one here on wordpress.org using subpages (8 posts)

  1. petter@brodin.no
    Member
    Posted 8 months ago #

    Wordpress.org has a top-level menu (Home, Showcase, Extend etc.). If you click on certain of these, such as Extend, you're taken to a site that has a sidebar with a submenu that shows the children of the Extend-page. If you click one of these, it keeps displaying the children of the Extend page, marks the one you clicked as active, and shows you its children.

    I don't know if this is solved using subpages, but does anyone know of a way to solve this using pages and subpages in Wordpress?

    I have a top-menu that shows only the top-level pages, but I can't figure out how to make a submenu to show what I've described.

    Thanks in advance for all your help.

  2. MichaelH
    moderator
    Posted 8 months ago #

    I believe that can be accomplished--see Markup and styling of page items (wp_list_pages).

  3. petter@brodin.no
    Member
    Posted 8 months ago #

    What's your idea? Are you thinking about hiding the irrelevant links? I tried that, but couldn't get it right.

  4. MichaelH
    moderator
    Posted 8 months ago #

    What's your idea?

    Actually nothing, but to make it known that 'current_page_item' was available to you, and that your CSS skills would precipitate a solution.

  5. petter@brodin.no
    Member
    Posted 8 months ago #

    I think I've explained myself poorly, then.

    Imagine that I have a page hierarchy like this:

    Top link 1
    --First sub level 1
    ----Second sub level 1
    ------Third sub level 1
    ----Second sub level 2
    --First sub level 2
    ----Second sub level 3
    Top link 2
    --First sub level 3
    --First sub level 4
    ----Second sub level 4
    ------Third sub level 2
    ------Third sub level 3
    --First sub level 5
    ----Second sub level 5
    --First sub level 6

    The top menu would list "Top link 1" and "Top link 2" (which is no problem to do using wp_list_pages())

    If I were to click the "Top link 2", the sidebar should show the following: (again, no problem with wp_list_pages)
    First sub level 3
    First sub level 4
    First sub level 5
    First sub level 6

    Clicking "First sub level 4" should show
    First sub level 3
    First sub level 4
    --Second sub level 4
    First sub level 5
    First sub level 6

    Clicking "Second sub level 4" should show
    First sub level 3
    First sub level 4
    --Second sub level 4
    ----Third sub level 2
    ----Third sub level 3
    First sub level 5
    First sub level 6

    and so on.

    Is this clearer?

  6. MichaelH
    moderator
    Posted 8 months ago #

  7. tammyhart
    Member
    Posted 8 months ago #

  8. westy808
    Member
    Posted 5 months ago #

    I am trying to get something going similar to that of the original question posted. Easiest way to explain my goal is to think of the menus I'd like to create as having three separate columns of menus.

    For example purposes, if you where on page home >> domestic vehicles >> fords

    there would be three menus:
    1) containing 'home' and its siblings (contact us, locations, warranty)
    2) containing 'domestic vehicles' and its siblings (imports, compacts)
    3) containing 'fords' and its siblings (GM, Dodge)

    okay, so my example might be outdated next week - but I'd really appreciate any help clarifying how to do something like this.

Reply

You must log in to post.

About this Topic