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. Filtering a custom post type by custom taxonomy in archive template
  62. get term archive url / link
  63. The Operator “NOT IN” Does Not Work In tax_query
  64. Post type archive page not working
  65. Unable to filter on field on edit.php page
  66. Help with hierarchical custom taxonomies and permalinks…almost there
  67. How to get only one category of custom post type?
  68. Adding posts of custom type into the main feed
  69. Create separate template for shared custom taxonomy with shared terms
  70. Connecting a taxonomy with a post type
  71. How to achieve representation of streets index with custom taxonomies
  72. How to filter custom taxonomy categories on archive?
  73. Custom template won’t load for a custom post type (custom permalinks used)
  74. Adding a custom post type taxonomy template in plugin
  75. Loading custom content type from ajax results?
  76. Custom post type and taxonomy – show related posts
  77. Add custom image size for custom post type or taxonomy
  78. Can’t remove front from permalinks for custom taxonomy category page
  79. How to make custom taxonomy into drop down select in a custom metabox
  80. Sitemap generation
  81. Main query not querying any posts in custom taxonomy template
  82. Wp Query with multiple custom tag(taxonomy) by get the terms
  83. Problems with custom taxonomies
  84. Meta box data is saved but NOT displayed in the meta box text field. Why?
  85. How to display class name in this shortcode post query
  86. Retrieve Custom Taxonomies with Description and Slug
  87. How to list posts by term (custom taxonomy)
  88. Use custom post type taxonomy between cpt slug and name
  89. How to order taxonomy terms by most recent post?
  90. Building Link List for Custom Tax
  91. Best way to have one product in both rental and sale parent category
  92. Custom taxonomy term links out of order
  93. Unexpected behavior from custom taxonomies
  94. Custom taxonomy in custom post type archive with pagination
  95. List a custom taxonomy’s terms, with links, on the taxonomy page
  96. How to get child taxonomies
  97. WP Query WordPress Post Type with the same Taxonomy name
  98. Top 30 Songs using Custom Post Type
  99. show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
  100. Custom post type with custom taxonomies structure url not working archive of CPT
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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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