Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Pete on "My search.php 'query posts' isn't doing what i'm asking it to"

$
0
0

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 all articles
Browse latest Browse all 8245

Trending Articles