[Resolved] Displaying only child menu items of parent menu items in sidebar

Home Forums Support Displaying only child menu items of parent menu items in sidebar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #341254
    onlyonemj

    This is a bit tricky. Has anybody experimented with or found an easy way to display only the child menu items of a given parent menu item in sidebars?

    I have a preference on hard-coding than using a plugin to limit bloat. But if hard-coding is complicated then a plugin will have to do.

    Here’s a visual presentation of what I’m trying to achieve:

    This is the normal navigation menu structure. We are focusing on the RENTING & BUYING > BUYING IN LONDON structure here:

    Normal main menu structure

    When you click on the Aquisitions Case Studies submenu item, this is what comes up on that page’s sidebar:

    Sidebar nested/tabbed menu showing child items

    As you can see, it shows all the child menu items of RENTING & BUYING as tabs/nested menu within the sidebar.

    Can this be achieved easily?

    GeneratePress 1.3.48
    #341398
    Leo
    Staff
    Customer Support

    Hi there,

    I believe this user was looking for the same thing but unfortunately it’s not easily achievable.

    Check out this topic for more info: https://generatepress.com/forums/topic/sidebar-sub-navigation/

    #341861
    onlyonemj

    Thank you for the reference Leo. I managed to get it to work the way I wanted using the hard-coded method as per link Tom suggested. I’m not sure why Les was not able to implement it.

    Here’s a screenshot of what I achieved after some CSS tweaks:

    Coded sidebar child menu items

    Link for code used: http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-child-pages-for-a-parent-page-in-wordpress/

    #342025
    Leo
    Staff
    Customer Support

    Awesome! Thanks for sharing 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.