After several hours of debugging I have found what caused the problem. Custom taxonomy ‘cadassist_category’ is used for 2 custom post types: product_document and cadassist_file. The posts for taxanomy with ID 653 were of cadassis_file type. And I tried to get posts of product_document type. That is why I got empty array.
So if you have similar problem then maybe your custom taxonomy is used for several post types and you just query for a wrong post type.
Related Posts:
- How to have this permalink structure: post_type/postname/custom_inner_page
- how to get this tax_query working?
- Get posts by category name
- How to search through all child taxonomies using WP_Query?
- Query a custom taxonomy in a function to create an csv file
- Display all posts in a custom post type, grouped by a custom taxonomy
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- How to put custom post types on front page
- How to add multiple images to a custom post type single post?
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- Custom query – alternate posts by category
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Retrieving 3 latest post from each of 5 different custom post types
- how to group custom post type posts by custom taxonomy terms
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Querying Posts by Taxonomy From Alternate Network Site
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Query for posts in 2 taxonomies
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Ordering Custom Post Types with WP_Query
- Paginated Taxonomy Term Archive including one post per term
- How do I create an archive page for standard posts?
- Limit users by custom taxonomy and user roles
- Generate Shortcodes by Taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- wp_query to find posts by year and month
- Querying Term Posts in Loop
- Custom Post Type Loop within Shortcode
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Displaying a custom post types custom taxonomy value?
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Display CPT posts based on specific taxonomy
- Filtering WP_Query Dynamically on the Front-End
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- wp_query check if integer exists in custom field’s array
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- custom taxonamy and post type
- Return the latest post from a custom Taxonomy and Post Type
- Don’t know how to show custom taxonomies from a custom post_type
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- Query Multiple Custom Posts by Custom Fields
- Custom taxonomies relationship
- How to get the intersection of two terms both from different custom taxonomies
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_query
- How to produce a sub-page-system in WordPress
- WordPress wp_query() basic question about args
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query with custom post type ID
- How to get the post terms from a child taxonomy
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- Exclude latest post from WP_Query taxonomy term loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Display featured posts for a custom post type by taxonomy
- What is the most efficient way to execute recursive complex queries?
- date_query empty results with custom post type
- set object terms after some some time of published post – functions.php
- Get next and prev item from custom WP_Query and Custom Post Type
- Sort custom posts by date and then by taxonomy
- have to do a while have post to show for two custom post types sharing the same taxonomy?
- display post count in archive page that have relation with another taxonomy term
- Custom Post Taxonomy Template Not Loading Properly
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How to display only child category post in related posts in custom post type?
- WP_query sort by taxonomy
- Error get_posts with Custom Taxonomy and OR relation
- Get post from Category by Priority
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Help with Multi Level Category Archive Page
- Get posts of an specific term of a custom taxonomy
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- Loop carousel slider in wordpress
- This wp_query will not return any posts and only seems to work with post_status inherit?
- WP_Query for CPT with filter by another WP_Query
- show custom taxonomies in hierarchy
- Loop with Custom Post Type and Taxonomies
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Storing/querying custom date data
- Catergory args causing loop not to show
- Attaching multiple custom taxonomies to one CPT?
- How to manage wordpress knowledge base/wiki/posts collections
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Default WordPress Query for a Specific Custom Post Type URL
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Query custom post type and group by taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy