You can use wp_list_categories() which by default, generates nested unordered lists (ul) and just pass product-category
as the taxonomy parameter for example:
add_filter('wp_nav_menu_items','add_custom categories', 10, 2);
function add_custom categories($items, $args) {
$items .= '<li>' . wp_list_categories( array('echo' => 0, 'taxonomy' => 'product-category', 'title_li' => 'Product Categories') ) . '</li>';
return $items;
}
Related Posts:
- Remove custom posts that match taxonomy value
- Using Custom Posts with Metaboxes and Drop-downs
- Sidebar links for different pages
- Blog Posts in Custom Menu
- How to display data in archive page?
- Set terms in a custom post
- Get posts of ONE taxonomy term of custom post type
- Duplicate Custom Post Type and Taxonomy Slug
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Redirect to another page using contact form 7? [closed]
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- disable Tab post on nav-menus page (Admin)
- relating business and products with custom taxonomy?
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- How To Use Custom Tax of a Post Type
- Show post count in custom taxonomy page
- Customizing URL slugs of Custom Post Type and Taxonomy make posts/pages 404
- Multiple Custom Post Type loop logic
- How to list all names and descriptions of a custom taxonomy
- “Current” class on a singular page menu item with custom post types?
- 404 for some custom taxonomy not ALL taxonomy
- Special Query: Title, Terms, Content – %LIKE%
- Taxonomy Category category.php not working
- Dynamic Menu Item
- How to display by default only published posts/pages in the admin area?
- Find out who deleted a page or post?
- Post/Page Preview Template
- using wp_update_post on save_post
- Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy
- WordPress plugin to publish to multiple remote WordPress blogs
- Convert IPTC keywords to blog post tags
- Adding Post Counts to Menu (Nav) Programmatically?
- How to wrap every image in a post with a div?
- Show One Category on Post
- WordPress Delete hook with wp_delete_post function?
- Order post by year DESC and month ASC
- Do I use custom post type or something else?
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- How do I get the slug of a custom taxonomy category of a post?
- What Defines What Category A Post Picks (if in multiple)
- Delete Post From Front-End and attachment permanently
- Custom post type permalinks breaking due to 3.1 bug fix
- ‘Invalid post type’ error when importing from one site to another
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- Get post id in wordpress action?
- disable column on post and user list
- Edit custom post type admin menu link
- Get posts by name and taxonomy term
- How to include a post type in the admin/backend?
- How to make number of blog posts a custom field?
- WordPress blog or WordPress website
- Using custom post template
- Hiding Draft Post In Admin
- Adding custom fields to bbpress reply form
- Force the “Choose from the most used tags” meta box section to always be expanded
- Making a custom Pagination for multi page blog post
- How to list recent posts in a wp nav menu?
- How to display posts via custom taxonomy terms using checkboxes?
- Thumbnail & Category link aside post
- Loop parent terms {display posts} AND loop child terms {display posts}
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Is there a query string for edit.php to show all posts that have no custom taxonomy terms?
- WordPress custom post type with folder structure in slug
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- Show custom post with custom categories with specific slug
- Display the 2nd category name of a custom post type without error if its null?
- How to call posts under a specific category on static front page?
- Optimize CPT-function with a loop
- Add post tags to previously created custom post type
- How to display only one category in a custom post type?
- wp_list_categories() Exclude All Categories Except One
- Geting error in post and category [closed]
- WordPress Post Deletion Issue
- How Can I Always Display A Particular Post First Using WP_Query?
- MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?
- Change modified date to current date when title updated automatically
- Menu does not foward to the linked posts
- How to put the author of the post in the comments?
- I want to add the 10 most recent posts under a parent category on the main menu
- How to add a custom class attribute into code wrapper? [duplicate]
- Redirecting wordpress search query to archive page
- Post not using taxonomy template
- Create/Set Category as Title of Post
- Custom Post Type Rewrite URL
- Custom Post Types and Broken Permalinks
- Page with Category Returning 1
- Using WP page password protection as defacto login
- I lost the link to my posts in my menu bar
- Keep highlight on menu item with post pages
- Show Posts By Custom Field
- How to retrieve custom field values and save again as array
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Hiding menu on mobile only when viewing posts?
- Customize search results to include custom posts and display in a specific template page
- Custom permalink based on custom post type fields
- Checking if some condition is matched before inserting post into database
- How do i put a dropdown list of ALL my post in the sidebar menu?
- How remove “recent comments” title without modifying code? [closed]
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields