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

Count posts with specific term_meta

$base_array        = array(
    'posts_per_page'    => -1,
    'fields'            => 'ids',
    'post_type'         => 'cpt',
    'post_status'       => array('publish'),
    'date_query'        => array(
            'before'    => 'next Saturday',
            'after'     => 'last Monday'
    ),
    'tax_query'        => array(
            'taxonomy'  => 'pas_here_taxonomy'
            'field'    => 'slug',
            'terms'    => array( 'hardware', 'software'),
'operator'      => 'IN'
    )
);

$base = get_posts($base_array);

echo count($base);

Related Posts:

  1. Advanced search form with filters for custom taxonomies and custom fields
  2. Custom Post Type Category List & Post Count
  3. Taxonomy list. Order by a specific custom post type count
  4. Custom Meta Boxes – Nonce Issue – Move to trash issue
  5. Show metabox in custom-post-template depending on taxonomy term?
  6. Displaying Metabox value (custom post type taxonomy)
  7. get_queried_object error How to show post count by month in the taxonomy page
  8. How can I display my custom metaboxes on a custom post template?
  9. need advice on how to do a lists using custom post types – taxonomy vs postmeta
  10. Does WordPress limit the length of slug names for Post Meta or Terms?
  11. Query/list all terms and their custom post count
  12. How to duplicate entire custom post type
  13. Post count by month of taxonmy term
  14. Metabox not show in categories custom post type cmb2
  15. Display different information of a custom post type
  16. Filter posts by tax (dropdown) and meta value
  17. how to show records that don’t have custom meta value
  18. I am trying to get cutom post cout by month of current taxonmy term
  19. how to count the current posts terms
  20. How to count other posts not having specific taxonomy terms?
  21. best way to use custom taxonomy, post type and meta in a job system
  22. WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
  23. Custom Post Type meta data getting deleted on bulk editing taxonomies
  24. Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
  25. display post count in archive page that have relation with another taxonomy term
  26. get_queried_object not work in taxonomy page
  27. How to show custom post count in archive page
  28. Saving Child Terms on front end not setting parent
  29. Order posts by meta value hiding posts instead of re-ordering
  30. Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
  31. WordPress custom post type
  32. Values inside a custom field to determine which category posts to display
  33. Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
  34. Advanced search form with filters for custom taxonomies and custom fields
  35. Automatically add custom taxonomy when meta value gets to a set number or beyond
  36. Complex Custom Loop with Includes
  37. Hide load more button if no more post in selected category
  38. How to rewrite url for any specific taxonomy?
  39. Specific query for custom post type
  40. Custom post URL 404 error
  41. limit value taxonomy based on previous taxonomy value wordpress
  42. Dynamic dropdown select values depending on other custom field value
  43. Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
  44. How do I change the custom taxonomy slug to be the same as the custom post type slug?
  45. Limit number of custom posts per taxonomy
  46. Custom taxonomies relationship
  47. I want to change the word “Tags” in WordPress to something else, but how?
  48. Permalinks /country/city/cpt/postname/
  49. Number of Custom Post Types published are not being shown in the custom page
  50. Seamless permalinks between Custom Taxonomy and Custom Posts
  51. Update postmeta Parent when post_status child change
  52. Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
  53. What is the best practice for displaying my plugin content in themes?
  54. Categorize custom post type
  55. custom post type category count shortcode
  56. WordPress request fiter order by related post’s post_title
  57. How do I display the taxonomy for a custom post type in an array
  58. Pretty URL for custom search for custom post type
  59. Custom taxonomy rewrite with query var returns %2F in URL
  60. WP Rewrite Rule Issue while using Custom post type & taxonomy
  61. How to list custom taxonomies in the back end
  62. Several CPT’s with same Taxonomy name but with different Terms for each
  63. Remove slug in URL custom post type
  64. Custom Permalinks with CPT and Hierarchical Taxonomies
  65. How to conditionally redirect to the post from a taxonomy page?
  66. How do I check if the user is on a taxonomy term parent, child or grandchild page?
  67. Sort and filter custom post type posts by custom taxonomy
  68. How do I display the grand child items of a taxonomy term?
  69. How to edit this code to get the categories in achieve page?
  70. Taxonomies relations
  71. Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
  72. Is it better to use WordPress Custom Post Types or Taxonomies?
  73. Get general taxonomy name for a Custom Post Type
  74. Display Custom Taxonomy Alphabetically
  75. Import data from CSV with custom taxomony empty
  76. WordPress uses url different from defined in rewrite arg of custom post type
  77. Custom Post Type Loop with Query Var
  78. Full Custom Post Type List Organised by two Taxonomies
  79. Is it possible to use have_posts function to list custom post type posts inside a category?
  80. WordPress Doesn’t Generate Taxonomy Archive
  81. URL rewriting for CTP assigned entity
  82. How to have this permalink structure: post_type/postname/custom_inner_page
  83. Suggested Post and Taxonomy structure
  84. How do I require the specification of term in a custom post type and custom taxonomy?
  85. Custom Post, set object Taxonomy terms in plugin
  86. Query Custom Post Type Taxonomy term with multiple parameters
  87. Display post content with respect to its title?
  88. Hierarchy and access control for Custom Post Types (CPT)
  89. Update database from Quick Edit according to Checkbox state of Custom Post Type
  90. Custom fields (wp_post_meta) vs Custom Table for large amount of data
  91. Auto Complete Search
  92. Custom Post Type Pagination Paginates Only in URL Structure
  93. Set post terms for multiple posts
  94. Load Custom_post_type categories post with ajax
  95. Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
  96. Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
  97. Custom taxonomy returns 404
  98. Get terms that contain posts that in turn belong to other terms?
  99. WP-API select custom taxonomy when creating a post
  100. Best method to make posts searchable, sortable and filterable – custom field, tag or category?
Categories custom-post-types Tags count, custom-post-types, custom-taxonomy, post-meta
Quotes being escaped inside wp_editor when saved with wp_kses_post
How to untrash a post only if it was not a draft?

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