nextpage
分页有点奇怪。您必须解析帖子内容。这应该可以做到。
function get_nth_page($n=0,$content=\'\') {
if (empty($content)) {
global $post;
$content = $post->post_content;
}
if (empty($content)) {
return false;
}
$content = str_replace("\\n<!--nextpage-->\\n", \'<!--nextpage-->\', $content);
$content = str_replace("\\n<!--nextpage-->", \'<!--nextpage-->\', $content);
$content = str_replace("<!--nextpage-->\\n", \'<!--nextpage-->\', $content);
$pages = explode(\'<!--nextpage-->\', $content);
if (isset($pages[$n])) {
return $pages[$n];
}
}
你可以通过
$content
否则它会试图抓住
global
$post
变量