admin管理员组文章数量:1315989
I have an archive.php template which I only use for the blog.
The code goes a bit like this:
<?PHP
$the_query = new WP_Query( array(
'posts_per_page'=>9,
'post_type'=>'blog',
'paged' => get_query_var('paged') ? get_query_var('paged') : 1)
);
?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
Title, text, etc pulled through
<?php endwhile; ?>
<?php
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $the_query->max_num_pages
) );
?>
<?php wp_reset_postdata(); ?>
But then I go to Page 2, my 404 page displays instead.
本文标签: wp queryPagination not working on archivephp template
版权声明:本文标题:wp query - Pagination not working on archive.php template? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741988274a2408814.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论