我正在创建一个自定义主题,并且我很难在archive.php模板上实现分页。
我试图修改我在主博客页面上使用的代码,但它只是简单地显示了所有博客文章,而不仅仅是那些带有特定标签或类别的文章。
有什么想法吗?我哪里出了问题,如何让archive.php模板像分页一样正常工作?
提前谢谢你,
汤姆
'post',
'posts_per_page' => 10,
'paged' => $paged
);
$custom_query = new WP_Query( $custom_args );
?>
have_posts() ) : while( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
Read more
max_num_pages,"",$paged);
}
?>发布于 2022-01-06 16:08:51
解决方案非常简单,如下所示。
谢谢你的帮助莎莉CJ和汤姆J诺威尔。
Read morehttps://wordpress.stackexchange.com/questions/400983
复制相似问题