change index blog posts to actually use Loop

This commit is contained in:
John Bintz 2009-07-23 19:33:16 -04:00
parent eb1d65f14a
commit 6d5b487be6
2 changed files with 6 additions and 11 deletions

View File

@ -332,7 +332,7 @@ class ComicPress {
/**
* Gather blog posts for the given index page.
*/
function get_index_blog_posts() {
function get_index_blog_posts_query() {
global $post, $paged;
$t = $post;
@ -347,14 +347,7 @@ class ComicPress {
$paged
);
$posts = array();
if ($wp_query->have_posts()) {
while ($wp_query->have_posts()) { $wp_query->the_post(); $posts[] = $post; }
}
$post = $t;
return $posts;
return $wp_query;
}
function _glob($pattern) { return glob($pattern); }

View File

@ -20,8 +20,10 @@
include_partial('index-blog-header');
foreach ($comicpress->get_index_blog_posts() as $post) {
setup_postdata($post);
$index_posts_query = $comicpress->get_index_blog_posts_query();
while ($index_posts_query->have_posts()) {
$index_posts_query->the_post();
include_partial('index-blog-post');
}