Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Filter posts by tax (dropdown) and meta value

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:

  1. Advanced search form with filters for custom taxonomies and custom fields
  2. Saving Taxonomy Terms
  3. How can I filter posts by post_parent in the admin?
  4. How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
  5. Filter get_categories() for taxonomy term in WordPress
  6. Ajax filter with custom taxonomies
  7. Filter posts with ajax form and checkboxes
  8. Highlight nav menu terms
  9. Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
  10. Want to filter only parent post in admin area
  11. Custom Meta Boxes – Nonce Issue – Move to trash issue
  12. What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
  13. Show metabox in custom-post-template depending on taxonomy term?
  14. Custom Taxonomy breaking pages permalinks
  15. Displaying Metabox value (custom post type taxonomy)
  16. Filter custom post type archive page with custom taxonomies (categories) with AJAX
  17. How can I display my custom metaboxes on a custom post template?
  18. need advice on how to do a lists using custom post types – taxonomy vs postmeta
  19. Count posts with specific term_meta
  20. Does WordPress limit the length of slug names for Post Meta or Terms?
  21. How to query custom post types posts filtered by multiple custom taxonomies through a form selection
  22. Genesis filterable portfolio isotope [closed]
  23. How can I see a list of my Custom Post Types of the last term I was in?
  24. Displaying custom taxonomy in the admin list of a custom post type
  25. Categories of custom taxonomy don’t show any posts
  26. WordPress sort search results by custom order
  27. How to filter wp_list_categories output with some custom post type meta query?
  28. How to Filter custom post type by taxonomy?
  29. How to duplicate entire custom post type
  30. Filter term taxonomy metabox in custom post type
  31. How can I made custom taxonomies relationship?
  32. Metabox not show in categories custom post type cmb2
  33. Sort and filter custom post type posts by custom taxonomy
  34. Custom filter function not working with Custom post type
  35. Display different information of a custom post type
  36. how to show records that don’t have custom meta value
  37. Only show posts with a specific term of an associated taxonomy in a custom post type archive
  38. REST filters only firing when I have a param set
  39. Custom Taxonomy Filter Issues
  40. best way to use custom taxonomy, post type and meta in a job system
  41. Filter search posts by post meta?
  42. WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
  43. Custom Post Type meta data getting deleted on bulk editing taxonomies
  44. Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
  45. Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
  46. Store a value in global scope after init hook is fired
  47. Filter in Custom post type to find the parent post
  48. Insert custom taxonomy into category query
  49. Saving Child Terms on front end not setting parent
  50. Order posts by meta value hiding posts instead of re-ordering
  51. Creating adminable dynamic filtering on custom post type
  52. Dropdown switching subcategories portfolio
  53. Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
  54. WordPress custom post type
  55. Values inside a custom field to determine which category posts to display
  56. Exclude Custom Post Type from shared Custom Taxonomy
  57. Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
  58. Advanced search form with filters for custom taxonomies and custom fields
  59. Automatically add custom taxonomy when meta value gets to a set number or beyond
  60. Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
  61. How to Filter the Custom term loop based on dropdown
  62. Adding a custom post type taxonomy template in plugin
  63. Get post from custom post type order by two taxonomies
  64. Loading custom content type from ajax results?
  65. Get posts by querying taxonomy and certain terms of the taxonomy?
  66. How to restrict users and admin from creating new taxonomy terms?
  67. Posts from all the categories are being displayed instead of particular category
  68. How to save custom taxonomy from front end post submission
  69. How to convert custom post type based list to a dropdown list?
  70. How to add a custom taxonomy to show up in a custom post type menu?
  71. How to check if user meta field is empty in conditional else statement
  72. Overriding taxonomy and custom post type
  73. Get next and previous 3 posts in a term in single post page
  74. wp_query check if integer exists in custom field’s array
  75. Customize Query for post
  76. How to set YouTube video as featured image?
  77. Custom post type templating problem
  78. Correct classes for WordPress menu items
  79. Wrong request query on cpt and tax
  80. Custom Taxonomies not appearing in Admin
  81. Notice: Undefined index: error and understanding wordpress
  82. Custom Post hierarchical to custom taxonomy
  83. Custom Taxonomy Navigation, with current menu items for children?
  84. Search Custom Post Type & Taxonomies
  85. Getting a PHP Notice when using Pods with WPML [closed]
  86. Deleting Custom Taxonomy Term only increments tag_ID
  87. Custom Post Type doesn’t show Draft and Trash Options
  88. Conditional Statement custom post type category
  89. Multiple portfolios and single item in two of them (ideas?)
  90. Custom Post Type With Categories
  91. Get custom post type list for every category shortcode
  92. Loop custom taxonomy to get lists of cutom post types?
  93. Custom post type structure for posts with multiple child posts
  94. Get custom taxonomies from multiple posts
  95. Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
  96. Hierarchical Custom Post Types in Array
  97. Making certain categories of CPT not publicly queryable
  98. Pagination for Custom Taxonomy Page [duplicate]
  99. Filtering WP_Query
  100. How can I make a custom post type sticky?
Categories custom-post-types Tags custom-post-types, custom-taxonomy, filters, post-meta
Handling Multi-level custom taxonomy hierarchy
Stop image resizing in particular case – is that possible?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress