Forums › Forums › Search & Filter Pro › Display count for custom taxonomy display's count for all post types
- This topic has 3 replies, 2 voices, and was last updated 10 years, 5 months ago by Ross.
-
Anonymous(Private) June 5, 2014 at 6:47 am #1295
I have a custom taxonomy called deck-type and I have it assigned to a custom post called “deck” along with my “post”. I’m doing a filter form for just my “deck” posts and am filtering by the custom taxonomy deck-type but when I enable the display count, it display’s the total count of for each term of both “deck” and “post” post types instead of just displaying the count for just the “deck” since I am only filtering the deck post type.
Ross Moderator(Private) June 5, 2014 at 11:06 am #1300Hey John
Basically this “count” number is stored in WordPress’ own tables whenever you add/remove a post from your taxonomy and automatically covers all post types if used with multiple post types.
It is usually recommended to set up taxonomies exclusive to specific post types, so you could create two taxonomies one for each post type, and therefor you will have counts that match what you want.
This is a temporary workaround, having said that there is other functionality that a lot of users have been asking for, which I am making a priority to include which will help with your use case above.
Essentially the functionality I am looking to add is a “auto hide” of terms that have no posts – which would also auto update the counts displayed – I think this would work for you, see this feature request – https://support.searchandfilter.com/forums/topic/category-specific-searches/
Thanks
Anonymous(Private) June 5, 2014 at 6:51 pm #1325Thanks Ross,
I knew I would be able to create two taxonomies as a work around, but since both post types use the same taxonomy and I can query each post type and that taxonomy individually I like to keep the code/database as clean as possible with as little extra as possible.
I’ll just turn off the post count until you can fix it, I’m not sure how the plugin is setup but it would be nice that which ever post type is selected it only counts the post number for that taxonomy. Thanks.
Ross Moderator(Private) June 5, 2014 at 7:57 pm #1327Hey John, exactly this and more!
For example I have a search form like:
Categories
Apples (1) Bananas (1)
Tags
Green (1) Yellow (1)
And then a user selects
apples
, the form would look like:Categories
**Apples (1)** - selected Bananas (1)
Tags
Green (1) Yellow (0)
So this would work for all categories, tags & taxonomies, and hopefully more fields..
But this is a lot of work, so won’t be completed for a couple of weeks at least.
I’ll keep you updated.
Thanks
-
AuthorPosts