Forums

[resolved] search.php - displaying results without pagination (4 posts)

  1. Qbs
    Member
    Posted 6 months ago #

    in my admin panel I've set WP to display 3 posts per page and it works but I've noticed that this also influences the number of search results...

    I'd like all of my search results to be displayed on one single page, how do I do that?

    I reckon that the easiest way would be to change $posts_per_page; but I can't figure out ho to change it just for the search.php template

    I've also found something like <?php query_posts('posts_per_page=-1&post_type=post'); ?>
    but for the love of god I can't make it show ONLY the search results

    help...

  2. lhoylhoy
    Member
    Posted 6 months ago #

    I have exactly the same problem! help!

  3. cg219
    Member
    Posted 6 months ago #

    Hey poster, this should help

    <?php query_posts("$query_string . '&posts_per_page=-1'"); ?>

    Put that right before your loop. $query_string holds whatever the current query is. In this case it is your search.

    Good Luck =D

  4. Qbs
    Member
    Posted 6 months ago #

    cg219: THANKS!!!!!!!!!!!!!!!!!!! :)

Reply

You must log in to post.

About this Topic