0

I want my submenus to be generated automatically. I've used some plugins for this, but after a while they don't get updated anymore or they have a conflict with the theme I use.

I followed this question: Add child pages automatically to nav menu and it works great, but it shows grand-children pages in the menu as if they are direct children of the parent. Can anyone help me out with displaying the grandchildren in another submenu under the current submenu?

1

It's wise to avoid nav menus in cases like this where things may change frequently. Instead, you could look into using wp_list_pages() - with a custom walker if you need one to format it visually. Try wp_list_pages() right out of the box first and see whether you can just use CSS to style the list as desired. If not, then move on to a custom walker, which will also let you adjust the HTML.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.