- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Number of results not showing on "Archive"
Tagged: show number of results
Hi Trevor, I hope you have had a nice weekend.
Since setting up my code in an “archive” it is working great although when I try to display the number of results with the code from results.php it doesn’t work. I am trying the following code:
Found <?php echo $query->found_posts; ?> Results<br />
Which I copied from results.php
I’m sure it has something to do with “$query” but I have no idea what to replace it with?
Any ideas on this one?
Hi Tom
Archive display method uses the global $wp_query object, rather than the local $query.
So it should be:
Found <?php
global $wp_query;
echo $wp_query->found_posts;
?> Results<br />
Thanks