next_posts

函数
next_posts ( $max_page = 0, $echo = true )
参数
  • (int) $max_page Optional. Max pages. Default 0.
    Required:
  • (bool) $echo Optional. Whether to echo the link. Default true.
    Required:
    Default: true
返回值
  • (string|void) The link URL for next posts page if `$echo = false`.
定义位置
相关方法
next_postget_postsnext_posts_linkget_next_postget_post
引入
0.71
弃用
-

next_posts: 这个函数根据当前的查询检索WordPress循环中的下一组文章。如果有更多的文章要显示,它返回true;如果没有更多的文章,它返回false。

显示或检索下一个文章的页面链接。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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;
}
}
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; } }
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;
	}
}

常见问题

FAQs
查看更多 >