我的分页无法用于存档。php,我正在使用它作为博客文章类别链接的模板。
<div class="row">
<?php $the_query = new WP_Query( array(
\'posts_per_page\'=>1,
\'order\'=>\'DESC\',
\'paged\' => get_query_var(\'paged\') ? get_query_var(\'paged\') : 1)
); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<div class="col-lg-4 col-md-4 col-sm-12 blog-content text-styles">
<a class="blog-post-area" href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail(\'main-news-thumbnail-uncropped\', array(\'class\' => \'img-fluid post-image\'));
} ?>
<h3 class="post-title"><?php the_title() ?></h3>
<?php the_excerpt() ?>
<a class="blog-post" href="<?php the_permalink() ?>">Read More</a>
</a><!--End Link-->
</div><!--End Columns-->
<?php endwhile; ?>
</div><!--End Row-->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="pagination">
<?php
$big = 999999999; // need an unlikely integer?>
<?php 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();?>
</div><!--End Pagination-->
</div><!--End Columns--->
</div><!--End Row-->
有什么想法吗?我想不出来!