Forums › Forums › Search & Filter Pro › Count for All Items
- This topic has 6 replies, 2 voices, and was last updated 4 years, 3 months ago by Anonymous.
-
Anonymous(Private) August 3, 2020 at 6:54 am #254779
Hi, is it possible to display a count against the ‘All Items’ radio option for a filter? The filter is working fine and shows the count against the criteria I’ve set but would be good to show the ‘all’ count too:
https://holly.undermywing.org.uk/hen-rehomings/Screenshot of form attached.
Trevor(Private) August 3, 2020 at 12:22 pm #254822This post discusses this:
https://support.searchandfilter.com/forums/topic/total-count/#post-250604
Anonymous(Private) August 3, 2020 at 3:10 pm #254872Hi Trevor, sorry, this doesn’t seem to be doing what I thought – the total should be 43 but it’s pulling in 4:
https://holly.undermywing.org.uk/hen-rehomings/If I set the filter to ‘auto’ it does pull in the right total, but I need to change the labels.
Trevor(Private) August 3, 2020 at 3:33 pm #254877All it will do is count the counts from other options, which it is doing. If there are posts without options, that it cannot do. For that you would need to find the total posts count and add that to the label.
The input object does not have that count, but the results array does, generally fetched, I think, like this:
$total_count = $query->found_posts;
-
AuthorPosts