I'm able to get posts in a custom post type of "FAQ" and with a
category name of "bike", as in the code below.
The only real difference I made to your code was to remove the
'post_parent' restriction, and referenced the global $post before my
loop.
$args = array(
'post_type' => 'FAQ',
'category_name' => 'bike',
'numberposts' => -1,
'post_status' => null,
);
$members = get_posts($args);
global $post;
foreach ($members as $post) {
setup_postdata($post);
the_title();
echo '<hr />';
}
> ---------- Forwarded message ----------
> From: Ross Chapman <[email protected]>
> Date: Mon, Apr 12, 2010 at 5:53 PM
> Subject: [wp-testers] can't query/get posts of custom post type using
> category argument
> To: [email protected]
>
>
> Not working using category_name or category with ID. Example:
>
> <?php
>
> $args = array(
> 'post_type' => 'team',
> 'category_name' => 'Executive',
> 'numberposts' => -1,
> 'post_status' => null,
> 'post_parent' => $post->ID
> );
> $members = get_posts($args);
> foreach($members as $post) :
> setup_postdata($post);
>
> ?>
>
> Thanks,
> -Ross
> _______________________________________________
> wp-testers mailing list
> [email protected]
> http://lists.automattic.com/mailman/listinfo/wp-testers
>
_______________________________________________
wp-testers mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-testers