Make WordPress Core

Opened 7 weeks ago

Last modified 3 weeks ago

#64988 new enhancement

Enhancement: Add support for displaying child categories in Navigation “Category Link” block (dropdown support)

Reported by: wpsharif's profile wpsharif Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.9.4
Component: General Keywords:
Focuses: Cc:

Description

Currently, the Navigation block includes a “Category Link” block that allows selecting a specific category and linking to its archive page.

However, unlike the Page List block (which supports hierarchical parent–child page structures with dropdowns), the Category Link block does not provide any option to display child categories when the selected category has children.

---

### Problem
When a parent category is selected:

  • Only the parent category is shown in the navigation
  • Child categories are not displayed as a dropdown/submenu
  • No control exists to enable hierarchical category navigation

---

### Expected Behavior
Add a control in the Category Link block settings to:

  • Enable/disable displaying child categories
  • Automatically render child categories as a nested submenu (dropdown)
  • Respect category hierarchy similar to the Page List block

---

### Suggested Enhancements

  • Add a toggle option:
    • Display child categories
  • Optional improvements:
    • Depth control (limit levels)
    • Sorting options (name, count, etc.)

---

### Benefits

  • Improves consistency with Page List block behavior
  • Enhances UX for hierarchical taxonomies
  • Reduces need for custom code or manual menus
  • Useful for blogs, WooCommerce stores, and taxonomy-heavy sites

---

### Additional Context
This enhancement would make category navigation more flexible and align it with existing hierarchical navigation patterns in WordPress.

Attachments (1)

wp.png (103.1 KB) - added by wpsharif 7 weeks ago.

Download all attachments as: .zip

Change History (4)

@wpsharif
7 weeks ago

#2 @priyanshuhaldar
5 weeks ago

There is a workaround for this. You can add the sub-menu block and then add text for the primary menu item and link it to the parent category manually. Then, in the sub-menu item, add the category link block and link the child category there.

Check demo recording here: https://drive.google.com/file/d/135ozgWui6jHb4MXJkfF1ehHoncN4KkWW/view?usp=sharing

Though I'm working on a feature to add a sidebar control for the category link block to choose to display the child categories. Will be sharing an update here.

Last edited 5 weeks ago by priyanshuhaldar (previous) (diff)

#3 @priyanshuhaldar
3 weeks ago

Please check this PR https://github.com/WordPress/gutenberg/pull/77679 for the implementation. Let me know if this fulfils your enhancement request.

Note: See TracTickets for help on using tickets.