You can use below code:
$args = array(
'type' => 'product',
'child_of' => 0,
'parent' => '',
'orderby' => 'term_group',
'hide_empty' => false,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'taxonomy' => 'product_cat',
'pad_counts' => false
);
$cats = get_categories( $args );
Related Posts:
- Display all posts from all categories with pagination
- is_category() function
- Create terms when registering taxonomy?
- How to create a widgetized sidebar for every category dynamically?
- How do I edit pre_get_post for the category the user is currently in?
- Remove “Category Archives: title” at the top of a category page [duplicate]
- Category Alphabet List Broken
- WooCommerce – Display product child categories from specific parent
- Display only one result from “get_the_category_list”
- Display empty taxonomy terms with get_terms()
- Show list of categories even if they have no posts
- Assign an icon to a category post
- How can I show the subcategories content on the parent category page?
- How to control template resolution if both Author and Category filter in place?
- Resolved – category-slug.php not working after wordpress migration
- Custom Category/Subcategory structure
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Format Brand value in Category view [closed]
- Remove ‘rel’ attributes from the_category() output
- Default category link for a custom category is a broken link
- Get multidimensional array that reflects category hierarchy
- Add Post Screen Keep Category structure
- 3 Columns, 3 Categories, One Archive, and Pagination
- Possible to make a subdirectory that loops through a single category?
- editing fonts of category links from the_category() funtion
- Archives for each category on WP Multisite
- Update post title with category name after editing a category
- Automatically set default password to all posts in a specific category
- Style wp_list_categories
- Warn me about ‘uncategorized’ posts
- Categories showing page not found
- Why category.php throw 404 in wordpress while calling paginate_links()?
- How to get related tags based on a category?
- Send to different single pages by category when multiple categories exist
- How can you change the permalink for pages?
- Pagination for ajax category filter
- Get posts from specific taxonomy term
- limit a list of tags to one category [closed]
- WordPress Drop down category as array for using in page builder
- Get sort order of product categories
- How to select category on if function
- how to wordpress When I click on the category link, subcategories appear
- woocommerce related products by specific categories [closed]
- Problem with different query loops (and “main loop”) on category template page!
- Show posts in “image” format when viewed in category page, but with comments in blog
- Change the name Category – Not change category name
- How to change the order of the subcategory and category in a post?
- Properly setting up a feed
- custom page for custom Taxonomy
- Why get_category() function is not working not working when embedded in a page?
- Display Related Posts by “Category” “by Author”
- Change post title if post has specific category
- How to link a PDF file to a category URL
- How to schedule categories?
- Template for product-category page [closed]
- How set all posts in wordpress in one category
- Copy post taxonomy?
- custom query for both category and pages using global $wpdb;
- Change Default Content when Creating a Post based on Previous Category Choice
- Display category and associated post listings
- How to get sub-categories to display same look as there parents
- Combining these queries? (Same taxonomy term + same category as post)
- get_object_term_cache duplicate terms after update to wordpress 6
- WordPress PageNavi Plugin not working in category.php
- Ignore the Ad on Specific Categories
- Different post slug based on archive
- How do I make an array to get the category name, dynamically, in an archive template?
- Post does not show category wish just show latest post
- How can I add different custom fields for each category in the same post?
- Sidebar by Category Conditional Statement not functioning
- Style post archive blog preview based on category
- Woocommerce Category Sort Dropdown
- How to check a category checkbox using JavaScript
- Need help to structure our a complex hierarchy
- global categories – Share specific categories in wordpress multisite
- WordPress update 4.7 – the 70.000+ news posts became “Uncategorized”
- create post with main category and other categories from admin panel
- How Can Hide Define Category in Post Contents?
- How to auto update post title and slug with category name when post status is updated
- get_posts – require all categories
- 404 error when i try to search by category or by tag
- Choosing different templates for categories
- Problem with wp_list_categories
- How do you add Author and date Published on Category Pages?
- hierarchical taxonomy in permalinks? using same slug
- Display one post on category.php: Wrong featured image
- WordPress Numeric Pagination with Query String [duplicate]
- Changing Permalinks for Category Pages Only
- Taxonomy for custom post type not found
- Twenty Eleven Theme [duplicate]
- display certain category on custom template page
- Get post by Category in custom template
- Ajax call activate after submit in edit-tags.php page
- How can I get this code to only output one link?
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- comments_number fails to print
- Sorting Woocommerce products by category and attributes
- How to get Woocomerce categories count
- How to show child category name & post from it’s parent [closed]
- Open everything in new tab