Great question — answering as the UphillTech team:
There are a few ways to do this using the available Wordpress hooks. One such hook you can use is the wp_nav_menu filter ( see documentation ). This hook allows you to directly modify the output of the nav menu HTML. Be careful, as this will affect all menus unless you set a condition based on the args from the 2nd argument in the filter. An example implementation add_filter('wp_nav_menu', 'example_func',10,2); function example_func(string $nav_menu, $args): string { // Get categories $categories = get_categories(['taxonomy' => 'product_cat']); //create new unordered list and append to end of navigation. $nav_menu .= '<ul>'; foreach($categories as $cat) { $nav_menu .= '<li>' . $cat->name ....
Full answer by T Paone: https://stackoverflow.stackexchange.com/a/77717554 (CC BY-SA 4.0).
Need it done for your business? UphillTech.