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
- CPT archive redirects to single post
- How to bulk-untag multiple posts?
- Show posts by a custom post author
- Force the “Choose from the most used tags” meta box section to always be expanded
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- wp-cli post create & media import issues
- More then one menu items are assigned with “current-menu-item” class
- Posts list in custom taxonomy
- How can i limit the number of posts created per category?
- Search results posts_orderby and ID
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- One menu for frontpage (one pager), and a different menu for posts
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Get Posts Under Custom Taxonomy
- Prepending %category% onto default posts fails
- get_adjacent_post by language
- Automatically add date to the auto generation of post slug
- Permission issue with custom post type – not added to menu – by plugin
- How could I change my Permalink from blog to custom structure? [closed]
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- WP Admin register taxonomy and post type performance
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- Calling Different Custom Post Timestamps in a table
- How can I setup a relationship using categories in WordPress?
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Admin – create custom post status and display above table
- custom post template file not shown, instead all the time 404.php
- How to list recent posts in a wp nav menu?
- How to display posts via custom taxonomy terms using checkboxes?
- Set Default Category to Username
- How to allow visitors to filter posts by multiple taxonomies
- How can I hide tags on a child-category page, if that tag has not been used?
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- 404 error on default post type and default taxonomy fronted page
- Thumbnail & Category link aside post
- Using wp_list_pages() after calling query_posts()
- How to include my own css in post
- Show posts count for Categories and Tags in wp_nav_menu
- How to add category post count in main navigation menu [closed]
- Custom post types related to same custom post type?
- Dynamically switch template on click
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- Is it possible to customize the post according to post format in single.php?
- Customize rel=canonical tag for single blog post
- a little direction on custom post type
- Loop parent terms {display posts} AND loop child terms {display posts}
- How to Use index.php file for “Blog” Page And this is Not a Home Page
- Format latest/newest post differently
- Custom taxonomy archive page problem
- Tell WP to use a specific template file in posts
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Best Way to Add UnEditable HTML to Posts
- Is there a query string for edit.php to show all posts that have no custom taxonomy terms?
- How safe is it to delete old posts edits to save database space?
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Custom Post Type archive
- WordPress custom post type with folder structure in slug
- Using setup_postdata() with multi-dimensional array
- Is codex right on deleting post?
- How can I list posts by author?
- Check if a custom post type has already been created
- WordPress Query Posts From Category Post on Static Page
- Edit multiple custom post types while saving a new or edited post