The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How to remove pagination from search.php template (3 posts)

  1. marc0047
    Posted 7 years ago #

    I'm trying to create a search output page with search.php where there is no pagination. I thought the following would work, but what it does is pull up all posts with any query input.

    <?php query_posts('posts_per_page=-1'); while (have_posts()) : the_post(); ?>
    [do stuff]
    <?php endwhile; ?>

    Anyone know the solution or how a good article to point me to?

  2. jfsimard
    Posted 7 years ago #

    That is almost exactly what I am trying to do with my monthly archive page. I am using:
    <?php query_posts($query_string . "&posts_per_page=-1") ?>
    so it does not affect the rest of the query string -

    I am still getting the pagination though. How can we remove pagination with the same query? Is there a parameter that will do it?

  3. jfsimard
    Posted 7 years ago #

    Update: It seems to remove pagination since both the next_posts_link and prev_posts_link are not printed.

Topic Closed

This topic has been closed to new replies.

About this Topic