Ask your WordPress questions! Pay money and get answers fast! (more info)

Add Accordion to Menu WordPress

My current WordPress code generates the top most parents and their children on every page:

I need two things:

1. I need the pages in the menu ordered alphabetically, echo the name of the parent page (non-linked_ for the top most menu item (the parent page name) and create a link for each parent page as the first menu item in each dropdown. Here is an example:

2. I need this menu to be made into an accordion menu

If this will help, here is my HTML and CSS quickly thrown together on CodePen:

The menu should be compatible with all major browsers.

Answers (2)


Bob answers:

If you like to use plugin then this will be helpful
[[LINK href=""]][[/LINK]]

It has shortcode also.

And here is great tutorial.
[[LINK href=""]][[/LINK]]

To make it alphabetically ordered you have to show us code which is generating menu html.
passing order by in your query will be helpful.

are you generating it using categories? are you using wordpress menu system? or they are pages sud subpages?

Bob comments:

You example site is using this plugin
[[LINK href=""]][[/LINK]]

You can use wordpress backend menu system to generate menu as you wish. Thus you can handle order by yourself.


Arnav Joy answers:

check these two plugins:-