<?php
$categories = get_the_category();
$categoryIDS = array();
foreach ($categories as $category) {
array_push($categoryIDS, $category->term_id);
}
$categoryIDS = implode(",", $categoryIDS);
?>
<?php if (get_previous_post($categoryIDS)) { previous_post_link('上一篇: %link','%title',true);} else { echo "";} ?>
<br/>
<?php if (get_next_post($categoryIDS)) { next_post_link('下一篇: %link','%title',true);} else { echo "";} ?>
wordpress实现文章页上一篇/下一篇功能
最新推荐文章于 2021-03-21 22:18:48 发布