You need to pass the category name as well if you want to show posts from specific category..
You just need to add one more param to the get_posts array.
REPLACE THIS
<? $products = get_posts( array('post_type' => 'products', 'posts_per_page' => 400,) ); ?>
WIth THIS
<? $products = get_posts( array('post_type' => 'products', 'category_name' => 'category_name_here', 'posts_per_page' => 400,) ); ?>
Related Posts:
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Taxonomies relations
- Create a shortcode to display custom post types with a specific taxonomy
- List the categories under custom taxonomy
- Custom Post Type and Taxonomy URL rewrite
- How to build a complex page structure
- Remove admin menu for custom taxonomy attached to custom post type
- How do I list custom taxonomy terms without the links?
- Page not found taxonomy custom post type
- How to replicate some of Drupal Views functionality in WordPress?
- Archive page with multiple taxonomies rewrite
- Sorting for each custom taxonomy
- How to get_queried_object on multiple objects?
- Dynamic variable for custom taxonomy in loop?
- custom taxonomy – Template not working
- Count number of posts which exist in 2 taxonomies?
- Getting taxonomy terms used by custom post type
- Want to turn WordPress into a paid subscription directory
- Removing Duplicate Custom Taxonomy Terms from within a Dropdown Select?
- How to customize admin posts based on the user who is logged in
- taxonomy template for custom post type the same as the archive
- How to output wordpress custom tags separated by comma?
- Custom taxonomy template for multiple custom post types
- Custom Post Types for Support Ticket plugin?
- Add/Remove current_page_parent class
- Use different taxonomies in different custom post types’ permalinks?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Search Custom Post Type & Taxonomies
- Get custom taxonomies from multiple posts
- How to hook custom taxonomies to custom post types and make the permalinks work?
- Help need making decision. Ads rotating site on wordpress
- Categories of custom taxonomy don’t show any posts
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Use Custom Post Type archive page for the taxonomies term archive page
- Is it possible to have dedicated page for parent/child taxonomy?
- Can a Custom Taxonomy be named “category” like normal Posts?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Nested Custom Post Type or Custom Post Type Parents?
- limit value taxonomy based on previous taxonomy value wordpress
- Limit number of custom posts per taxonomy
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Display related custom taxonomy posts in sidebar
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- Different slug taxonomy for two different CPT
- Create metaboxes based on custom post type
- custom post type and custom taxonomy
- Why does my taxonomy have a category style div id?
- Get custom post type categories to show up in menus
- Custom Type add Transitions
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Post type date archive for custom taxonomy
- How to loop through custom taxonomies and sub taxonomies and display posts?
- WordPress custom permalink and archive link for custom post type
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Custom post type name and assigning custom taxonomy
- Building a Portfolio and need some direction
- Custom Post Type Custom Archive Page Not Working
- Correct way of adding taxonomy to a custom post type
- Query Custom Post Type by Taxonomy
- WordPress custom taxonomy page
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- How to create Custom Taxonomy Search Drop Down for specific Post Type
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Set priority to permalinks
- Change dynamically the dropdown list value
- How to list posts by terms
- CPT UI: Connect a custom post type to a custom post type
- List posts of custom post type under category name
- Custom post type and taxonomy same slug
- How to show terms used only for particular custom post type. Filter creation perpose
- Single taxonomy for different custom post types
- How should i name the .php file to show custom posts under a taxonomy’s term?
- What’s the most efficient way to get two queries based on an if statement?
- Displaying custom posts in categories
- Best approach to allow front-end display of posts’ reviewers?
- Query pulling all taxonomies, not one I am specifying
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- Is it possible to add and display custom post types to an array?
- Custom post type and custom taxonomies display
- Displaying posts exclusively in their category (not parent)
- predefined custom field on registration page
- Displaying taxonomy icon outside archive page
- Why won’t this rewrite rule work?
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- How to not have the items of the subtaxonomy within the parent taxonomy
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Tags and Taxonomy links not working for Custom Post Types
- Geolocate Custom Post Type on Save
- Inserting two categories
- How to manage a bookstore
- How can i change url structure of cpt like this?
- Rewrite Rule for custom post type link with or without taxonomy terms
- How to add to taxonomies to a post type