To do the taxonomy query in your case, the code would be like this:
if (isset($_POST['cat']) && !empty($_POST['cat'])){
$args['tax_query'] = array(
array(
'taxonomy' => 'roadkill_category',
'field' => 'id', // or slug
'terms' => $_POST['cat'],
'operator' => 'IN'
)
);
}
If you have further questions about tax query, please refer to the Codex.
Related Posts:
- Advanced search form with filters for custom taxonomies and custom fields
- Saving Taxonomy Terms
- How can I filter posts by post_parent in the admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Filter get_categories() for taxonomy term in WordPress
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Highlight nav menu terms
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- Want to filter only parent post in admin area
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Show metabox in custom-post-template depending on taxonomy term?
- Custom Taxonomy breaking pages permalinks
- Displaying Metabox value (custom post type taxonomy)
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How can I display my custom metaboxes on a custom post template?
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Count posts with specific term_meta
- Does WordPress limit the length of slug names for Post Meta or Terms?
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Genesis filterable portfolio isotope [closed]
- How can I see a list of my Custom Post Types of the last term I was in?
- Displaying custom taxonomy in the admin list of a custom post type
- Categories of custom taxonomy don’t show any posts
- WordPress sort search results by custom order
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- How to duplicate entire custom post type
- Filter term taxonomy metabox in custom post type
- How can I made custom taxonomies relationship?
- Metabox not show in categories custom post type cmb2
- Sort and filter custom post type posts by custom taxonomy
- Custom filter function not working with Custom post type
- Display different information of a custom post type
- how to show records that don’t have custom meta value
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- REST filters only firing when I have a param set
- Custom Taxonomy Filter Issues
- best way to use custom taxonomy, post type and meta in a job system
- Filter search posts by post meta?
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Store a value in global scope after init hook is fired
- Filter in Custom post type to find the parent post
- Insert custom taxonomy into category query
- Saving Child Terms on front end not setting parent
- Order posts by meta value hiding posts instead of re-ordering
- Creating adminable dynamic filtering on custom post type
- Dropdown switching subcategories portfolio
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- WordPress custom post type
- Values inside a custom field to determine which category posts to display
- Exclude Custom Post Type from shared Custom Taxonomy
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- Advanced search form with filters for custom taxonomies and custom fields
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- How to Filter the Custom term loop based on dropdown
- Adding a custom post type taxonomy template in plugin
- Get post from custom post type order by two taxonomies
- Loading custom content type from ajax results?
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to restrict users and admin from creating new taxonomy terms?
- Posts from all the categories are being displayed instead of particular category
- How to save custom taxonomy from front end post submission
- How to convert custom post type based list to a dropdown list?
- How to add a custom taxonomy to show up in a custom post type menu?
- How to check if user meta field is empty in conditional else statement
- Overriding taxonomy and custom post type
- Get next and previous 3 posts in a term in single post page
- wp_query check if integer exists in custom field’s array
- Customize Query for post
- How to set YouTube video as featured image?
- Custom post type templating problem
- Correct classes for WordPress menu items
- Wrong request query on cpt and tax
- Custom Taxonomies not appearing in Admin
- Notice: Undefined index: error and understanding wordpress
- Custom Post hierarchical to custom taxonomy
- Custom Taxonomy Navigation, with current menu items for children?
- Search Custom Post Type & Taxonomies
- Getting a PHP Notice when using Pods with WPML [closed]
- Deleting Custom Taxonomy Term only increments tag_ID
- Custom Post Type doesn’t show Draft and Trash Options
- Conditional Statement custom post type category
- Multiple portfolios and single item in two of them (ideas?)
- Custom Post Type With Categories
- Get custom post type list for every category shortcode
- Loop custom taxonomy to get lists of cutom post types?
- Custom post type structure for posts with multiple child posts
- Get custom taxonomies from multiple posts
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Hierarchical Custom Post Types in Array
- Making certain categories of CPT not publicly queryable
- Pagination for Custom Taxonomy Page [duplicate]
- Filtering WP_Query
- How can I make a custom post type sticky?