在主题的function.php文件中定义一下函数。

function single_page_nav_link() {
	?>
	<div class="post_nav_link">
	<?php
	$categories = get_the_category();
	$categoryIDS = array();
	foreach ($categories as $category) {
			array_push($categoryIDS, $category->term_id); }
			$categoryIDS = implode(",", $categoryIDS);
	?>
	<div class="pre_post"><?php if (get_previous_post($categoryIDS)){previous_post_link('上一篇: %link','%title',true);}else{ echo '上一篇: (无)';}?></div>
	<div class="next_post"><?php if (get_next_post($categoryIDS)) {next_post_link('下一篇: %link','%title',true);}else{ echo '下一篇: (无)';}?></div>
	</div>
	<?php
}

然后在模板文件的相应页面导航的位置插入下列代码即可。

<?php single_page_nav_link(); ?>