如何使导航链接在Wordpress中的 single.php 文件中通过尊重的类别
<nav id="nav-single">
<h3 class="assistive-text"><?php _e('Post navigation', 'twentyeleven'); ?></h3>
<?php previous_post_link('%link', __('<div class="nav-previous"></div>', 'twentyeleven')); ?>
<?php next_post_link('%link', __('<div class="nav-next"></div>', 'twentyeleven')); ?>
</nav>
答案 0 :(得分:0)
好吧,我明白了......让第三个参数toTRUE($ in_samecat = TRUE)将遍历同一类别...并且谢谢
<nav id="nav-single">
<h3 class="assistive-text"><?php _e('Post navigation', 'twentyeleven'); ?></h3>
<?php previous_post_link('%link', __('<div class="nav-previous"></div>', 'twentyeleven'),TRUE); ?>
<?php next_post_link('%link', __('<div class="nav-next"></div>', 'twentyeleven'),TRUE); ?>
</nav>