Build an accordion navigation widget
Accordion adds the MD → Accordion Nav widget. It lists the categories of a taxonomy as collapsible sections, each showing its newest posts and a link to the category's archive. You choose the taxonomy, the order, how many categories and posts to show, and whether the current page's category opens.
Before you start
- You need an Administrator account on a site running Marketers Delight 6.0 or later.
- Accordion also requires WordPress 6.2 or later and PHP 7.4 or later.
- Install and activate the Accordion Drop-in.
- Choose a sidebar or widget area where the navigation should appear.
Add the widget
- Go to Appearance → Widgets.
- Add MD → Accordion Nav to the widget area you chose.
- Open the widget's settings.
- Select a Category type to list. The widget uses categories by default; you can choose any public taxonomy, or Auto-detect categories to use the first taxonomy of the post type being viewed.
- Enter a Title if the widget needs one.
- Select Save in the widget form.
Choose the categories and posts
These options control which categories appear, in what order, and how much of each one shows.
| Option | What it controls | Default |
|---|---|---|
| List direction | Ascending or descending order | Ascending |
| Order by | Name, Posts count, Slug, Category ID, Category Order, or Latest post | Name |
| Posts per category | How many posts show inside each category, newest first | 5 |
| Categories to show | How many top-level categories show | Every category |
| Exclude | Category IDs to leave out, separated by commas | Empty |
Latest post puts the category with the most recently published post first, so a list of products or topics shows whatever was updated last at the top. With List direction set to Descending, the oldest comes first instead.
When Categories to show cuts the list short, a See all link to the post type's archive follows it, such as "See all 14 changelog categories →". Leave the field empty to show every category.
Show parent categories only leaves child categories out. Otherwise, child categories nest inside their parents. Show post count per category adds a count beside each category.
Open the current page's category
Check Open the current page's category to highlight where the reader is. On a category archive, or on a post in one of the listed categories, that category moves to the top of the list and opens, along with any parent categories. The current post is highlighted inside it.
On pages without a matching category, such as a post type archive or the home page, every section stays closed.
See more text sets the link at the end of each category's posts. {category} and {count} are available in this field. When the field is empty, the link reads "See more in {category} →". CSS classes adds classes to the accordion wrapper.
Show only posts related to the page
Only show posts that share the page's limits the accordion to posts that have the same category as the current page in a second taxonomy. For example, a product page in a "Stream" product category can list only the docs filed under that same product, grouped by their docs categories.
- In Category type, select the taxonomy to group by, such as your docs categories.
- In Only show posts that share the page's, select the taxonomy the page and the posts have in common.
- Select Save.
When this setting is on:
- Every matching post shows in its category, and there is no See more link, because the category's archive would also show unrelated posts.
- If only one category has matching posts, it opens automatically.
- On a page that has no category in that taxonomy, the widget doesn't show.
Check the result
Open a page where the widget area appears. You should see category sections that expand to show their newest posts. If you set Categories to show, a See all link follows the list when there are more.
The widget shows nothing at all, title included, when no category has posts to list. If it is missing, check that it's in the intended widget area, then check Category type, Exclude and Only show posts that share the page's. If you use a caching plugin, clear its cache and reload.


