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
檢視更多 >