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.
|
* Gather blog posts for the given index page.
|
||||||
*/
|
*/
|
||||||
function get_index_blog_posts() {
|
function get_index_blog_posts_query() {
|
||||||
global $post, $paged;
|
global $post, $paged;
|
||||||
|
|
||||||
$t = $post;
|
$t = $post;
|
||||||
|
@ -346,15 +346,8 @@ class ComicPress {
|
||||||
'&paged=' .
|
'&paged=' .
|
||||||
$paged
|
$paged
|
||||||
);
|
);
|
||||||
|
|
||||||
$posts = array();
|
|
||||||
if ($wp_query->have_posts()) {
|
|
||||||
while ($wp_query->have_posts()) { $wp_query->the_post(); $posts[] = $post; }
|
|
||||||
}
|
|
||||||
|
|
||||||
$post = $t;
|
return $wp_query;
|
||||||
|
|
||||||
return $posts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _glob($pattern) { return glob($pattern); }
|
function _glob($pattern) { return glob($pattern); }
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
|
|
||||||
include_partial('index-blog-header');
|
include_partial('index-blog-header');
|
||||||
|
|
||||||
foreach ($comicpress->get_index_blog_posts() as $post) {
|
$index_posts_query = $comicpress->get_index_blog_posts_query();
|
||||||
setup_postdata($post);
|
|
||||||
|
while ($index_posts_query->have_posts()) {
|
||||||
|
$index_posts_query->the_post();
|
||||||
include_partial('index-blog-post');
|
include_partial('index-blog-post');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue