Can't get my WP_Query loop to work, cannot figure out why category__in
won't work. Just want to pull certain categories FROM my custom post type
$args = array(
'post_type' => 'bbt',
'category__in' => array(90,89)
);
$loop = new WP_Query($args);
when I use echo $loop->found_posts;
it does returns 0, BUT I have 2 posts in total from those categories
EDIT: Here is how the category was assigned:
$labels = array(
'name' => _x( 'Big Boys Toys Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Tag', 'taxonomy singular name' ),
'search_items' => __( 'Search Types' ),
'all_items' => __( 'All Tags' ),
'parent_item' => __( 'Parent Tag' ),
'parent_item_colon' => __( 'Parent Tag:' ),
'edit_item' => __( 'Edit Tags' ),
'update_item' => __( 'Update Tag' ),
'add_new_item' => __( 'Add New Tag' ),
'new_item_name' => __( 'New Tag Name' ),
);
// Register Custom Taxonomy
register_taxonomy('tagbbt',array('bbt'), array(
'hierarchical' => true, // define whether to use a system like tags or categories
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'tag-bbt' ),
));
bbt
post type assigned tocategory
taxonomy?category
taxonomy to your post type