[wp-hackers] query_posts with custom taxonomy and custom post type

Otto otto at ottodestruct.com
Thu Apr 15 17:40:24 UTC 2010


On Thu, Apr 15, 2010 at 12:09 PM, Christian Foster
<christian.foster at gmail.com> wrote:
> This code however always ignores the post_type requirement but still
> selects all post types linked to the term_name;
>
> global $wp_query;
> query_posts( array(
>    'post_type' => 'message' ,
>    "taxonomy_name" => "term_name",
>    'showposts' => 10 )
> );
>
> From everything I have read the last section of code should work as
> expected - is it incorrect?

The post_type is ignored for taxonomy based queries. See trunk,
query.php, line 2034.

-Otto


More information about the wp-hackers mailing list