Use WP_Query instead of query_posts().
$cpt_args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'furniture'
)
)
);
$cpt_query = new WP_Query( $cpt_args );
Related Posts:
- How to show all posts of the category in wordpress?
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- 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
- 4 posts per page from single category
- Custom post type archive page filters
- 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 to get post content by calling ajax?
- Display a query with multiple post types and same relationship on a single page
- Order by & include array by specific post ids
- Get category id from post id of a custom post type
- How to call a custom post with get_posts() instead of query_posts()?
- Retrieving 3 latest post from each of 5 different custom post types
- Custom-Taxonomy as categories: Remove “most-used” tab?
- how to group custom post type posts by custom taxonomy terms
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Query post types with multiple keys
- List all custom post type posts from a given category?
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Get permalink and title by post name?
- Taxonomy structure of Sport site
- Get all posts WHERE custom_field is LIKE value
- get custom post type categories
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- How to display recent / random posts by its category
- Custom post types and permalink
- reference the current category being used in the category.php page
- Search doesn’t find tags or categories in custom post types
- Querying Term Posts in Loop
- Get Post Primary Category
- How to add custom post types to normal category pages
- Add category attribute to custom shortcode
- Linking to the most recent post in a Custom Post Type
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Posts from all the categories are being displayed instead of particular category
- Page template with different page and post content
- wp_list_categories() – current-cat class also inside posts?
- Limit amount of posts made within a custom taxonomy
- Post injections into Site Origins Page builder [closed]
- WordPress posts page for customer filtering and sorting along with category filter
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Why is my category template ignoring post type?
- Not sure if I should create multiple custom post type [closed]
- Custom post types and category archive
- BBPress Search results in WordPress search
- 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)
- Categorise Custom Post Types
- Tag page only display 10 posts
- in_category for custom post types
- WP_Query Custom Post Type if Category ID Equals
- Custom post types and ‘new WP_Query’
- Showing custom post type categories in the menu
- Creating Sections for Post Types
- Count custom post type based on two meta data
- attach CPT data to a taxonomy
- Listing all slugs?
- List categories, subcategories and posts from custom taxonomy and custom post type
- Categories won’t appear on custom post type
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types category
- Custom Post type showing up in loop, regular posts are not showing up
- Advanced archive url structure (category, tag and date)
- Displaying taxonomies as category links within sidebar and creating pages for these
- Custom post category name showing empty
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- How to show related posts of category on post within custom posttype
- Trying to list years (for a filter) but not all years display
- Sudden 404 pages on product category archives
- Custom Post Types – trying to make “title” display
- Convert category to custom post type
- How can I display a specific category on Front-Page
- How to seperate posts by categories?
- WooCommerce change
- Adding categories to custom post type in permalink
- I can not call the categories of custom post type
- Custom Post Type is not respecting assigned categories
- Help with Travel Guide Setup
- update a posts of other custom post type
- Project Category Heading
- Getting Custom post category from Form
- Imported Content Doesnt Show Up On Frontend
- Optimise custom post type queries
- Front end page submission form does not attach custom post type
- Filter RSS feed for custom post type to events for next 7 days only
- Best way to structure article and issue relationship for CPT
- Custom Post Type used for FAQs Accordion
- Category slug not showing for Custom Post Type
- Get a list of categories ids
- category page template for custom post type
- Custom Post Type Permalinks with %category%
- Return Custom Post Type Categories
- Query custom type posts by array of IDs
- Using tax_query to get single post per category
- Is it possible to make is_category() recursive?
- Trying to set up a range filter for related custom post types
- Display ACF object field data using Elementor Custom Query