get_the_category()
only works with the default taxonomy, per the Codex page; you probably need to use get_the_terms()
instead.
So you’d replace your get_the_category()
call with get_the_terms( $post->ID, 'brands' );
, if I’m not mistaken.
Related Posts:
- Exclude a category from WP_Query
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Show Post Count of a Category
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Querying Term Posts in Loop
- Show custom post type filtered by category
- Custom post types and ‘new WP_Query’
- Variable not working in WP_Query
- How to Display Posts From Category Within a Custom Taxonomy?
- display posts of custom post type with custom taxonomy
- How to query Posts from a custom post type which contains a custom taxonomy?
- How to manage a dynamic multi-level page hierearchy system?
- Custom Post By Category
- Only show current category post
- Post Editor: display categories from current post type taxonomy only?
- Sort ACF by custom taxonomy
- WP Query filtering by custom category not showing all relevant posts
- Loop on front-page.php
- Get categories and descriptions from custom post type
- Combining custom post type and post category
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Show Two custom Post type and their posts on category page
- wp_query to find posts by year and month
- WP_Query is printing out only one post when posts_per_page is set to multiple
- How to create new category for custom post type?
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Weird problem happening with custom taxonmy when creating/updating posts
- is there a way to retrieve posts that do not have a featured image assigned?
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- How to get the post type from a category id?
- Filter by custom taxonomy slug on a custom post type
- Pagination on category page with custom post types
- Insert HTML inside link in a walker
- Custom Post Types and independent Categories – complex Taxonomy
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Should I use custom taxonomy or custom post type
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Set menu active state for custom posttype and category, given custom taxonomy term
- How to show CPTs in term archive
- How to add post_type=value when editing that post type in the WordPress admin?
- Display CPT posts based on specific taxonomy
- shortcode to show custom post types by category
- Display all posts in main category and 1 subcategory
- showing custom post types of a certain category only
- Query/list all terms and their custom post count
- Linking to the most recent post in a Custom Post Type
- Custom Post Type Archive Page Filtering
- Getting posts under the custom post type ui category
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Posts from all the categories are being displayed instead of particular category
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Conditional Statement custom post type category
- Custom Post Type With Categories
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Missing Posts in Custom Taxonomy List
- Search / Filter posts on Title/Content OR Tags
- Categories sorting
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Allow user to set custom order to a list of custom taxonomies?
- get_category_parents for custom post type taxonomy
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Disable block with taxonomies at post page
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- forming WP_Query for posts of all post types but from specific categories
- wp_list_categories() – current-cat class also inside posts?
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- Which post does a taxonomy term belongs to?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- List custom taxonomy specific to one custom post type
- 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
- Custom taxonomy rewrite give pagination 404
- Add custom post type settings to wordress default posts
- Hide parent categories when clicked, and show it’s childs
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- Problem with displaying posts in the CPT category
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Can’t remove front from permalinks for custom taxonomy category page
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Custom taxonomies relationship