通过尊重类别旅行的导航链接

时间:2012-11-21 14:23:17

标签: wordpress

如何使导航链接在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>

1 个答案:

答案 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>