Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:48:06+00:00 2026-05-26T20:48:06+00:00

I have searched and cannot find a custom Walker class that will hide the

  • 0

I have searched and cannot find a custom “Walker” class that will hide the submenus from wp_nav_menu until you are on the parent page. I have found lots of ways to hide them or just show the submenus but not a way to only show submenus when you are in that section. Below is an example of how I need it to display:

Wp_nav_menu structure as it currently stands:

  • Parent 1
  • Parent 2
    • Child 1
    • Child 2
  • Parent 3
    • Child A
    • Child B

-Display-

On Parent 1 / Homepage:

  • Parent 1
  • Parent 2
  • Parent 3

On Parent 2 and Parent 2 child pages:

  • Parent 1
  • Parent 2
    • Child 1
    • Child 2
  • Parent 3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:48:06+00:00Added an answer on May 26, 2026 at 8:48 pm

    You don’t need a custom walker to do this, it can be done using the CSS classes, and display:none;

    e.g. you could start with:

    .menu .sub-menu { display: none; }
    .menu .current-menu-item .sub-menu { display:block; }
    .menu .current-menu-ancestor .sub-menu { display:block; }
    

    With a few additional rules, based on the classes applied to the body tag you could conditionally show and hide other menu items, using classes added to the menu items via the backend.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched but cannot find the jQuery selector that gets an element by
I have searched Codeplex, NuGet and Google with system.web.razor +source and I cannot find
I have searched through similar questions on here, and cannot find an exact answer.
I have searched but cannot find the answer to a frustrating problem of mine.
I have searched high and low and cannot find a Samsung Omnia SDK. I
I have searched and searched and I cannot find a page which spells out
I have searched a long time and cannot find a solution to my problem.
I have searched around on the net but I cannot find a method of
I've searched google and cannot find any answers to the particular problem. I have
I have searched around and cannot find an answer. Say I have a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.