Support » Plugins » Hacks » My search.php 'query posts' isn't doing what i'm asking it to

  • I have a search.php template
    I have this code below, I’m asking the loop to only show 2 search posts at a time but it has decided it deserves to show more.

    <?php global $query_string; query_posts( $query_string . '&orderby=date&order=asc&posts_per_page=2' ); ?>
    <?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( 'content' ); ?>
    <?php endwhile; ?>
    <?php else : ?>
    <?php get_template_part( 'content', 'none' ); ?>
    <?php endif; ?>

    Any help greatly appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘My search.php 'query posts' isn't doing what i'm asking it to’ is closed to new replies.