I have created a custom post type called "community", created a new post with a category (
cat id = 6). I am using the following code:
$args = array ( 'numberposts' => -1, 'post_type' => 'community', 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'category' => 6 ); $communities = get_posts($args);
It worked perfectly inside my page.php. However, it's not working when I am trying the same inside category.php page, I am not getting the posts accurately! It's returning all the other posts.