函数原型
next_posts( int $max_page, bool $echo = true ): string|void
函数描述
Displays or retrieves the next posts page link.
是否弃用
未弃用
函数参数
-
$max_page
int
Optional - Max pages. Default 0.
-
$echo
bool
Optional - Whether to echo the link.
Default:
true
函数返回值
string|void The link URL for next posts page if $echo = false.
函数位置
File: wp-includes/link-template.php.
函数源码
function next_posts( $max_page = 0, $echo = true ) {
$output = esc_url( get_next_posts_page_link( $max_page ) );
if ( $echo ) {
echo $output;
} else {
return $output;
}
}
源码链接
变更日志
| Version | Description |
|---|---|
| 0.71 | Introduced. |

