You have orderby=count
, which should be correct, but you also have order=asc
. order=ASC
means “smallest to largest”, at least with numbers. You want the opposite, “largest to smallest”. Use order=DESC
instead. I suspect that get_terms
is working, you’ve just told it something different that you actually want.
Also, you have multiple queries in a loop and no real limits on it. That could result in a huge number of database queries and a noticeable impact on server performance. Be aware.
Related Posts:
- Filtering a custom post type by custom taxonomy in archive template
- Exclude a category from WP_Query
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How to build a complex page structure
- Ordering posts by custom taxonomy in admin area
- Custom Taxonomy Template Post List with Sort Order
- How to filter custom post types by custom category taxonomy
- Ordering Posts List By Taxonomy Terms?
- Is there a way to use regular categories with custom post types?
- How to list all categories and tags in a page?
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- remove support for ‘Categories’ for a custom post type
- Glossary with Custom Post Type
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Filter get_categories() for taxonomy term in WordPress
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Custom edit post column – category not showing
- Taxonomy list. Order by a specific custom post type count
- How to show custom taxonomy in the permalink?
- Custom post type taxonomy template
- Custom/separate categories for custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Taxonomy structure of Sport site
- Display Custom Category (taxonomy) Name in Custom Post Type
- get_categories() for only CPT
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Show Post Count of a Category
- custom taxonomy archive by year
- Get categories and descriptions from custom post type
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Combining custom post type and post category
- Querying Term Posts in Loop
- How to create new category for custom post type?
- Weird problem happening with custom taxonmy when creating/updating posts
- Insert HTML inside link in a walker
- Custom Post Types and independent Categories – complex Taxonomy
- Should I use custom taxonomy or custom post type
- Set menu active state for custom posttype and category, given custom taxonomy term
- Display all posts in main category and 1 subcategory
- Custom Post Type Archive Page Filtering
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Posts from all the categories are being displayed instead of particular category
- Conditional Statement custom post type category
- Custom Post Type With Categories
- Allow user to set custom order to a list of custom taxonomies?
- get_category_parents for custom post type taxonomy
- wp_list_categories() – current-cat class also inside posts?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Show a Category X’s custom post type on Category X archive page?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- Sorting the Loop by Taxonomy Value
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- Sort custom posts by date and then by taxonomy
- How to show related posts of category on post within custom posttype
- How to display custom taxonomy term specific post?
- How to set “section categories”?
- Create custom post type categories
- How to sort post category using its Description
- Show Custom Post Type based on Category on Archive Page
- Set a Default CPT taxonomy by taxonomy id
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- Custom category taxonomy – archive page not showing up
- week days sorting based on starting day
- Help with Travel Guide Setup
- How to sort custom post’s category by id from the theme’s function.php?
- Custom post types not displaying per category
- Custom post type category archive URL redirects to home page
- Help with Multi Level Category Archive Page
- Ordering Posts List By Taxonomy Terms?
- Dropdown switching subcategories portfolio
- Display custom Taxonomies same as listing Categories
- Custom post type taxonomy not sorting correctly
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Display 2nd category, only once, as sub-heading, in the loop
- Post Editor: display categories from current post type taxonomy only?
- Get a list of categories ids
- Trying to create hierarchy between 3-4 custom post types
- Customize category URL
- Category / Custom Post Type permalink issue
- Display a custom post type list by taxonomy term
- How can I sort posts ascending by post title for a specific post type, but on a category archive template?
- Return Custom Post Type Categories
- Remove slug from Custom Category Permalink + dual-category permalinks
- Highlight specific menu item when custom post is page
- Test if a Category contains certain Custom Post Types
- How can I show second most recent post in sidebar, if most recent post is open in the browser?
- Is it possible for post and custom post type to share a category base slug?
- How to add categories to a custom post type using wp_insert_post($new_post);
- WP Query filtering by custom category not showing all relevant posts
- How to get the proper category in permalink with custom post type assigned to multiple categories
- Category display using conditions