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