WP_Query on CPT Archive Page including Custom Taxonomy
-
I am running these args through WP_Query (returned by object to verify):
[query] => Array ( [post_type] => post [category__in] => Array ( [0] => 1 ) [orderby] => date )
And this is being run:
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)LEFT OUTER JOIN wp_term_relationships ON wp_posts.ID=wp_term_relationships.object_id LEFT OUTER JOIN wp_term_taxonomy USING (term_taxonomy_id) LEFT OUTER JOIN wp_terms USING (term_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (1) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND (taxonomy = 'attachment_type' OR taxonomy IS NULL) GROUP BY object_id ORDER BY GROUP_CONCAT(wp_terms.name ORDER BY name ASC) LIMIT 0, 20
This is only happening on a custom post type archive page, and attachment_type is obviously a custom taxonomy linked to the CPT.
This is causing an error of:
WordPress database error: [Not unique table/alias: ‘wp_term_relationships’
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WP_Query on CPT Archive Page including Custom Taxonomy’ is closed to new replies.