在函数中添加以下函数。php文件。
function custom_post_link($format, $link, $in_same_cat = false, $excluded_categories = \'\', $previous = true) {
if ( $previous && is_attachment() )
$post = & get_post($GLOBALS[\'post\']->post_parent);
else
$post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
if ( !$post )
return;
$link = get_permalink($post);
$format = str_replace(\'%link\', $link, $format);
$adjacent = $previous ? \'previous\' : \'next\';
echo apply_filters( "{$adjacent}_post_link", $format, $link );
}
而不是调用previous\\u post\\u link(\'%link\',\'\',TRUE)函数,将其调用为custom\\u post\\u link(\'%link\',\'\',TRUE),它将输出如下路径
http://www.website.com/photo/1085