@ricardio-de-penning
I think you are going on wrong direction.
You just want to get only those posts which is related to current category right?
If yes then you need to filter post using tax_query like below.
$args = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => array($cat_ids),
'operator ' => 'IN',
),
),
);
$query = new WP_Query( $args );
Related Posts:
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How to list all categories and tags in a page?
- Custom post type taxonomy template
- Show Post Count of a Category
- How to create new category for custom post type?
- Display all posts in main category and 1 subcategory
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Limit amount of posts made within a custom taxonomy
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- Create custom post type categories
- Set a Default CPT taxonomy by taxonomy id
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- Is it possible for post and custom post type to share a category base slug?
- How to get all taxonomies of a post type?
- How to change permalink structure for custom post type and it’s taxonomies?
- Get the first post term
- Filtering a custom post type by custom taxonomy in archive template
- Creating “static” taxonomies to choose from, inside custom post type?
- How to build a complex page structure
- How do I list custom taxonomy terms without the links?
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- Is there a way to use regular categories with custom post types?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How can you make permalink work for custom post type and taxonomy?
- Filter get_categories() for taxonomy term in WordPress
- How to get the parent’s taxonomy?
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- wp_insert_post custom taxonomy
- Taxonomy-{taxnonomy}.php is not working
- Taxonomy list. Order by a specific custom post type count
- Display taxonomy term only if there’s a value
- Get list of terms of current taxonomy archive for another taxonomy
- Custom/separate categories for custom post type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Menu Multiple Taxonomies
- Get categories and descriptions from custom post type
- Combining custom post type and post category
- How to make a custom taxonomy selectable in post publish area?
- Problem with custom post types, taxonomy and permalinks
- Fetch taxonomies by custom post type id array
- get_terms showing all categories instead of the ones assigned to a specific post
- Custom page template for category taxonomy
- How to show CPTs in term archive
- How do I get array of types associated with a taxonomy?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Show category ID on custom post type
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- get_category_parents for custom post type taxonomy
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Can’t remove front from permalinks for custom taxonomy category page
- Display a grid of taxonomy terms at root taxonomy page
- limit value taxonomy based on previous taxonomy value wordpress
- How to make custom taxonomy into drop down select in a custom metabox
- List of Posts and Categories
- WP the_posts() on single-cars.php get category link
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- Invalid Taxonomy
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- category list with cutom post count
- Include custom post type custom taxonomies in Categories widget
- Changing CPT slug and taxonomy already registered in parent theme
- Custom post type categories gives 404 error
- Custom Taxonomy Terms in Menu lead to which page?
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Custom post type specific category box
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- How to order taxonomy terms by most recent post?
- How to set “section categories”?
- Custom taxonomy returns 404 even with saving permalinks
- List all posts associated under custom taxonomy
- how to create custom taxonomy drop downs for parents and child
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Custom post type category link + add to menu
- How to create groups like that in buddypress?
- Filter Term By Parent Term – Custom Post Type
- Best approach to allow front-end display of posts’ reviewers?
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- Post Editor: display categories from current post type taxonomy only?
- List all posts from custom post type by taxonomy
- Archive templates based on taxonomies
- Trying to create hierarchy between 3-4 custom post types
- Customize category URL
- show only one category posts in admin
- Get all active posts that are tied to a custom taxonomy for a custom post type
- How can I show second most recent post in sidebar, if most recent post is open in the browser?
- How to add categories to a custom post type using wp_insert_post($new_post);
- Taxonomy term archive claims there are no posts, but there are. How to resolve?
- How to list custom taxonomy terms without the hyperlinks?