Title: Filter terms count with callback
Last modified: September 9, 2025

---

# Filter terms count with callback

 *  Resolved [Brendon Brown](https://wordpress.org/support/users/bigb159/)
 * (@bigb159)
 * [7 months ago](https://wordpress.org/support/topic/filter-terms-count-with-callback/)
 * Hi there. I use a callback per your documentation to populate the grid with custom
   post type posts which have ‘publish’ or ‘future’ post status with a date_query
   parameter to exclude posts before today.
 * Use case: a travel event grid, so I use the publish date for sorting and travel
   date, and custom taxonomies for front-end sorting.
 * Problem: Filter taxonomy terms count [i.e. “Rome (2)”] seem to be counted based
   on all published posts only (past posts, and no future/scheduled posts).
 * I’ve tried several things, but I can’t seem to figure out how to override this.
   I also played with Appearance > Filter Settings > Display Terms. Selected or 
   All Terms work (with wrong count) and both (hide empty) options hide all posts.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffilter-terms-count-with-callback%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [YMC](https://wordpress.org/support/users/wssoffice21/)
 * (@wssoffice21)
 * [7 months ago](https://wordpress.org/support/topic/filter-terms-count-with-callback/#post-18635371)
 * Hi!
 * The number of posts is calculated based on published posts and does not take 
   into account posts that have the status planned (future). To implement your task,
   you should use a custom solution using hooks to override the default plugin layouts.
   See the documentation [https://github.com/YMC-22/Filter-Grids?tab=readme-ov-file#custom-filter-layout](https://github.com/YMC-22/Filter-Grids?tab=readme-ov-file#custom-filter-layout)

Viewing 1 replies (of 1 total)

The topic ‘Filter terms count with callback’ is closed to new replies.

 * ![](https://ps.w.org/ymc-smart-filter/assets/icon-128x128.png?rev=3354891)
 * [YMC Filter](https://wordpress.org/plugins/ymc-smart-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ymc-smart-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ymc-smart-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/ymc-smart-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ymc-smart-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ymc-smart-filter/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [YMC](https://wordpress.org/support/users/wssoffice21/)
 * Last activity: [7 months ago](https://wordpress.org/support/topic/filter-terms-count-with-callback/#post-18635371)
 * Status: resolved