wp_reset_query() is a function that destroys the previous query used on a custom Loop. The function should be called after The Loop to ensure conditional tags work as expected.
Usage
Parameters
None.
Return values
None.
Examples
The following example shows how to use wp_reset_query() after a custom loop:
query_posts( 'posts_per_page=5' );
if ( have_posts() ) :
while ( have_posts() ) : the_post();
?>
endwhile;
endif;
wp_reset_query();
?>
More info: http://codex.wordpress.org/Function_Reference/wp_reset_query




Leave a comment