还没有检查你提到的插件。。。但我使用this solution 用于进行“作者”导航。
我调整了函数,如果没有插件(未测试),这可能会正常工作。如果需要更多的排除,则需要调整ID和条件本身。
[edit: corrected functions, the queries were missing the menu_order condition]
备注:
1) ID 99999对应于定义为首页的静态页面
2) 所有页面必须有一个定义的菜单顺序,我相信如果有0(零)作为菜单顺序的页面,这将不起作用
//PAGE.PHP
get_next_page_nav();
get_prev_page_nav();
//FUNCTIONS.PHP
function get_next_page_nav($link="%link", $title="%title") {
global $wpdb, $post;
$prev = $wpdb->get_row($wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type=\'page\' AND post_status=\'publish\' AND ID!=\'99999\' AND menu_order < \'".$post->menu_order."\' ORDER BY menu_order DESC LIMIT 1;"));
if($prev) {
$title = preg_replace(\'/%title/\',$prev->post_title, $title);
echo preg_replace(\'/%link/\', \'<a href="\'.get_permalink($prev->ID).\'" rel="prev" class="next-page">\'.$title.\'</a> \', $link);
}
}
function get_prev_page_nav($link="%link", $title="%title") {
global $wpdb, $post;
$next = $wpdb->get_row($wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type=\'page\' AND post_status=\'publish\' AND ID!=\'99999\' AND menu_order > \'".$post->menu_order."\' ORDER BY menu_order ASC LIMIT 1;"));
if($next) {
$title = preg_replace(\'/%title/\',$next->post_title, $title);
echo preg_replace(\'/%link/\', \' <a href="\'.get_permalink($next->ID).\'" rel="next" class="previous-page">\'.$title.\'</a>\', $link);
}
}