change index blog posts to actually use Loop
This commit is contained in:
parent
eb1d65f14a
commit
6d5b487be6
|
@ -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;
|
||||
|
@ -346,15 +346,8 @@ class ComicPress {
|
|||
'&paged=' .
|
||||
$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); }
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue