#20267 closed defect (bug) (invalid)
Query_Posts not matching Custom Post Type, Taxonomy and Post-id values
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | 3.4 |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: |
Description
I have created 1 custom Post Type (cpt)
+ 1 taxonomy (taxo) related to custom post type cpt.
i created 2 taxonomy terms (slugs : 'first_cat' & '2nd_cat')
I created a 'cpt' (id : 22) and "categorized" it to first_cat
When i do a query_posts with following arguments :
array ( "taxo" => "2nd_cat", "post_type" => "cpt", "p" => 22 )
the query_posts retrieves post 22 but should not due to taxo value !?
ps : i followed sample given in http://codex.wordpress.org/Taxonomies
Change History (2)
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
For reference, Taxonomy stuff is only used for non-singular requests; http://core.trac.wordpress.org/browser/trunk/wp-includes/query.php#L2204 specifiying a ID or name results in a singular request.
Note: See
TracTickets for help on using
tickets.

Since you've specified a exact post to retrieve (via the p param (name, page_id, or pagename should also result in the same thing)), my understanding is that it doesn't use the query vars.
You'll however want to look into using the newer Tax Query: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters