Word Press如何按分类在文章页面增加上一篇下一篇翻篇按钮
你只需要在single.php中你认为显示效果比较好的地方添加以下代码即可:
<pre class="wp-block-code">
term_id); } $categoryIDS = implode(",", $categoryIDS); if (get_next_post($categoryIDS)) { next_post_link('上一篇: %link','%title',true);} else { echo "已是最前文章";} echo ' '; // 间距 if (get_previous_post($categoryIDS)) { previous_post_link('下一篇: %link','%title',true);} else { echo "已是最后文章";} ?>
你可以根据你的文章布局添加上面的代码,下图是我添加的地方,帮助参阅: