我正在使用the_posts_pagination
创建分页,但也没有显示任何错误。我在这里共享代码。
PHP
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args10 = array(
'post_type' => 'post',
'posts_per_page' => 5,
'paged' => $paged,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => array(6,4,14)
)
)
);
$query10=new WP_Query($args10);?>
<?php if ($query10->have_posts()) : while ($query10->have_posts()) : $query10->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a>
<?php echo get_the_excerpt(); ?>
<?php echo get_the_date(); ?>
<?php $category = get_the_category(); echo $title = $category[0]->cat_name; ?>
<?php endwhile; endif; wp_reset_query(); ?>
<?php the_posts_pagination( array(
'show_all' => true
) ); ?>