WordPress 101 – Part 13: Create and manage the Pagination in your blog loop
视频学习参考: https://www.youtube.com/watch?v=xEA2zviCakw&list=PLriKzYyLb28nUFbe0Y9d-19uVkOnhYxFE&index=13
1.在index.php的posts循环中加入, 多篇文章分页
<?php next_posts_link(‘<< Older Posts’); ?>
<?php previous_posts_link(‘Newer Posts >>’); ?>
2.在single.php中循环加入,单篇文章分页
<?php next_post_link(‘<< Older Posts’); ?>
<?php next_post_link(‘<< Older Posts’); ?>
3.自定义硬编码分页,通过query_posts()
$currentPage = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
wp_reset_query();
Super Easily !