You write the wrong code
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array('posts_per_page' => '5',
'paged' => $paged,
'tax_query' => array( array('taxonomy' => 'news-categories',
'field' => 'slug',
'terms' => 'cbs-news')
)
);
You can also take help in WP_Query
Related Posts:
- How to get post content by calling ajax?
- How to show all posts of the category in wordpress?
- Get the ID of the latest post
- Retrieving 3 latest post from each of 5 different custom post types
- How to get only one category of custom post type?
- Quickest way to get last or oldest post date – WP Query
- Combine query_posts() and get_posts() into single query
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to query_post custom posts within default taxonomy?
- Show a Category X’s custom post type on Category X archive page?
- How to edit this code to get the categories in achieve page?
- Category with post type pagination returns 404
- Multiple (two) category postings on the same page.
- How to properly use Categories with Custom Post Types
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Custom post type archive page filters
- Custom post type data not displaying If I select the category from the dropdonw
- Modify default Related Posts Code to Custom Post Type
- Query the title of the page to show posts with matching category in the loop
- Display 2nd category, only once, as sub-heading, in the loop
- How can I list custom post by custom category?
- How do I correctly query posts from a post ID?
- show custom post’s post in two different divs [duplicate]
- Add Category names to post lists of custom post type
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- PHP variable not regenerating when publishing multiple posts at the same time
- Multiple level category drop-down from the WordPress dashboard
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Add custom post type settings to wordress default posts
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Problem with displaying posts in the CPT category
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Get link which associated with a specific category and tag
- Stuck in Order by more then one
- Custom Post Types with a common category for a blog listing
- Can’t remove front from permalinks for custom taxonomy category page
- How to get categories linked in posts for a specific post type
- Custom post type, organized by categories
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Query Multiple Custom Posts by Custom Fields
- Remove CPT name from permalink but add %category% instead
- Set a checkmark in a category based on a URL-parameter
- WP Query with categories only shows one post and ignores the category
- Polylang non-default language ignores tags in WP_Query
- Adding custom post type to count in category
- Custom Post Type and Category Base Rewrite Issue
- Get the category from custom post type
- Post injections into Site Origins Page builder [closed]
- Custom Post Type + Categories
- How to create a gallery page with categories?
- Custom Post Slug same as Parents Category Slug
- WordPress posts page for customer filtering and sorting along with category filter
- I am having Trouble to get list of Categories of Custom post Type
- Hierarchy and access control for Custom Post Types (CPT)
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Loop filtering Custom Post Types and/or Categories
- School & class blogs: Categorize with categories or custom posts?
- Custom post type and category link together
- Why is my category template ignoring post type?
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- How to get custom posts sub category link
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Query posts based on the meta key values of logged-in users?
- Not sure if I should create multiple custom post type [closed]
- Cross reference custom post types
- ‘exclude’ argument is not working with get_posts for a custom post type
- Make a custom_post translatable
- Pre-selecting the category for a custom post type
- How to get the intersection of two terms both from different custom taxonomies
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- browse by category and tags?
- Limit the post for differents custom post type in the same wp_query
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Categories filtering in new post
- Different Ways to Query Custom Post Types?
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom post types and category archive
- List of Posts and Categories
- BBPress Search results in WordPress search
- Custom post type archive page for multiple post types
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Listing all term items alphabetically / sorting loop
- How do you create a custom template to display a category with an image and related posts below?
- How can I list Custom Post Types created with the Types plugin under categories?
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- pagination not working for category.php (custom post types in categories)
- How to display Related Posts based on number of taxonomy terms matched
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- CPT category hierarchy
- Categorise Custom Post Types
- WP the_posts() on single-cars.php get category link
- Category.php template for custom posts
- How to retrieve category of a post in have_post loop?
- Filter date from post meta when date is in string format
- query_posts adding extra code to homepage
- Reworking function for counting custom post type posts count