Home › Forums › Back End › Multiple loops in WordPress › Re: Multiple loops in WordPress
December 5, 2011 at 3:34 pm
#91938
Member
After a lot of frustration, I referred back to the wordpress codex site. I re-wrote the whole section of code and it seems to work properly now. YAY!
// The Query
$the_query = new WP_Query( 'posts_per_page=3' );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
// The Title
echo '
the_permalink();
echo '">';
the_title();
echo '
';
// The Author
echo 'by ';
the_author();
echo '
';
// The excerpt
echo '';
the_excerpt();
echo '
';
// The date
echo '';
the_time('F j, Y');
echo ' ';
comments_popup_link('No Comments', '1 Comment', '% Comments');
echo '
';
endwhile;
// Reset Post Data
wp_reset_postdata();
?>