2. custom posts per page: http://rephrase.net/miscellany/05/perpage.phps
1. yes, but I dont remem. how 😛
Thread Starter
eleni2
(@eleni2)
Can someone still help me with #1? I used to have a solution called ‘search results’ plugin but it no longer works in WP 2.1. Thanks!
<?php
$mySearch =& new WP_Query("s=$s & showposts=-1");
$NumResults = $mySearch->post_count;
echo $NumResults;
?>
doesnt that work?
Thread Starter
eleni2
(@eleni2)
nope. it only shows the number of results on the current page. my search results are paginated.
Still no solution on this???
tylerhauser,
still no solution to what..? whats the problem that needs a solution?
the search results plugin was abandoned — I fixed it to work with 2.2, and more than like 2.1 …
http://www.village-idiot.org/archives/2007/05/26/search-results-count-plugin/
There’s no solution to showing the total number of returned posts for a search that has paginated results.
I know this topic got dropped a while ago, but I found an answer:
To count the total number of search results for a search that has paginated results, simply add this above your loop:
$hit_count = $wp_query->found_posts;
For example, my search results page looks like this:
<?php if (have_posts()) : ?>
<?php $hit_count = $wp_query->found_posts; // count # of search results ?>
<p>Your search for <b>'<?php the_search_query(); ?>'</b> returned <?php echo $hit_count . ' results'; ?></p>
.
.
.
(while loop, etc.)