Forums › Forums › Search & Filter Pro › Count posts based on filters
- This topic has 8 replies, 3 voices, and was last updated 8 years, 7 months ago by Anonymous.
-
Anonymous(Private) April 1, 2016 at 1:48 pm #41241
Hi,
is there a way to show counter of posts based on what is selected in filter? So if no selection it will show a number of all posts (ex. 45 results found), if I select something it will show a number of filtered posts (ex. 23 results found).
Regards
Trevor(Private) April 1, 2016 at 9:10 pm #41311Whilst I have asked Ross to take a look at this post, I just wish to make sure I have understood your question.
This is something different to have the numbers next to each category and the pagination, yes? Something like a heading that says:
23 results found based on your selections (if any)
at the top of the results, maybe?
Trevor(Private) April 1, 2016 at 9:15 pm #41313This thread may(?) be related:
https://support.searchandfilter.com/forums/topic/display-count-for-post-type/
Ross Moderator(Private) April 3, 2016 at 1:25 pm #41391Hi Klox
This is of course possible.
Which display method are you using?
With any query you can do:
echo $query->found_posts
Provided the name of the query is
$query
thanks
Ross Moderator(Private) April 5, 2016 at 7:51 am #41616I think what you want is
$wp_query->found_posts
It is part of any WordPress query, and tells you total found, not including pagination.
Thanks
-
AuthorPosts