You have to use array like this:
array(
'post_type' =>'news',
'category_name' => $category, //use category slug (NOT name).
'post__not_in'=> array($post->ID)
);
For more reference please visit this link
Related Posts:
- How to get the parent’s taxonomy?
- Display taxonomy term only if there’s a value
- Show Post Count of a Category
- Fetch taxonomies by custom post type id array
- Get related posts of child term of custom post type
- Several post types on WP Query by tag and taxonomy
- WP the_posts() on single-cars.php get category link
- display posts of custom post type with custom taxonomy
- How to query Posts from a custom post type which contains a custom taxonomy?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Get posts by category name
- Query Custom Post Type by Taxonomy
- Define multiple prefixes for custom post type
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How to manage a dynamic multi-level page hierearchy system?
- Custom Taxonomy – fields
- Filter By Term Not Working – Custom Post Type
- Displaying WordPress posts from post and custom post type in custom taxonomy
- How to display elements of different post types?
- Sort ACF by custom taxonomy
- Show Two custom Post type and their posts on category page
- tax_query returning all posts instead of selective posts in WP_Query
- wp_query to find posts by year and month
- How to make a custom taxonomy selectable in post publish area?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Querying Term Posts in Loop
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- How to check the terms in single custom post type template
- get_terms showing all categories instead of the ones assigned to a specific post
- How can I move a custom taxonomy and its data from one post type to another?
- is there a way to retrieve posts that do not have a featured image assigned?
- Group custom posts by custom taxonomy names
- Custom page template for category taxonomy
- How can i skip same post from taxonomy term?
- How to get the post type from a category id?
- Filter by custom taxonomy slug on a custom post type
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Why does querying on post_tags (which has been applied to custom post types) only return posts?
- Query Multiple Taxominies Across Multiple Post type’s
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- How to show CPTs in term archive
- How to add post_type=value when editing that post type in the WordPress admin?
- How do I get array of types associated with a taxonomy?
- Display CPT posts based on specific taxonomy
- shortcode to show custom post types by category
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Display all posts in main category and 1 subcategory
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Custom Taxonomies not appearing in Admin
- Show custom post type filtered by category
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Missing Posts in Custom Taxonomy List
- Search / Filter posts on Title/Content OR Tags
- Custom Post Type Taxonomy Filters
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- How do I do this with WordPress? Taxonomies?
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Disable block with taxonomies at post page
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Get latest 3 posts from multiple CPT in one query
- Which post does a taxonomy term belongs to?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- List custom taxonomy specific to one custom post type
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- How to Filter custom post type by taxonomy?
- Custom taxonomy rewrite give pagination 404
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Custom post taxonomies as tax_query terms?
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Custom WP Query on custom meta and sort by multiple meta keys value
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- limit value taxonomy based on previous taxonomy value wordpress
- Custom taxonomies relationship
- How do I display the taxonomy for a custom post type in an array
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- Taxonomies relations