Reputation: 4360
i've searching with no luck how to generate a custom wp_query that retrieve an specific category and post type = 'post' or just custom post type = 'bc'.
The idea is to "merge" in a page all posts with custom type 'bc' or category 'my-cat'.
I did a custom query without wp_query, just a custom made and ran it but seems to be very memory expensive and apparently is breaking my db, thats why i would like to try it as arguments of a new WP_Query().
Any idea please? thank you.
Upvotes: 0
Views: 2478
Reputation: 2263
See this section in the wordpress codex. http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters
$args = array(
'post_type' => 'bc', // or 'post' if you don't want your custom post type
'category_name' => 'my-cat'
);
$query = new WP_Query($args);
Upvotes: 0