我看不出仅使用标准参数就可以做到这一点,但您可以使用过滤器:
function link_hack_wpse_($output,$args) {
global $page, $numpages;
$xofy = $page.\' of \'.$numpages;
if (1 == $page) {
$output = str_replace($args[\'after\']," $xofy{$args[\'after\']}",$output);
} elseif ($page == $numpages) {
$output = str_replace($args[\'before\'],"{$args[\'before\']}$xofy ",$output);
} else {
$output = str_replace(\'</a><a\',"</a> $xofy <a",$output);
}
return $output;
}
add_filter(\'wp_link_pages\',\'link_hack_wpse_\',10,2);
$args = array(
\'before\' => \'<p>\',
\'after\' => \'</p>\',
\'next_or_number\' => \'next\',
\'separator\' => \'\',
\'nextpagelink\' => __( \'Next\' ),
\'previouspagelink\' => __( \'Previous\' ),
\'pagelink\' => \'%\',
\'echo\' => 1
);defaults
wp_link_pages( $args );
我应该注意到,这在很大程度上取决于
$args
设置。如果不进行修改,它将不可移植。