get_next_posts_page_link

函式
get_next_posts_page_link ( $max_page = 0 )
引數
  • (int) $max_page Optional. Max pages. Default 0.
    Required:
返回值
  • (string|void) The link URL for next posts page.
定義位置
相關方法
get_next_posts_linkget_next_post_linkget_previous_posts_page_linkget_next_image_linknext_posts_link
引入
2.0.10
棄用
-

get_next_posts_page_link函式用於在一個使用分頁的文章列表中生成一個指向下一頁的連結: 這個函式通常用在部落格或檔案頁中,以提供文章頁面之間的導航。

檢索下一個文章的頁面連結。

從2.1.3回傳到2.0.10。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_next_posts_page_link( $max_page = 0 ) {
global $paged;
if ( ! is_single() ) {
if ( ! $paged ) {
$paged = 1;
}
$nextpage = (int) $paged + 1;
if ( ! $max_page || $max_page >= $nextpage ) {
return get_pagenum_link( $nextpage );
}
}
}
function get_next_posts_page_link( $max_page = 0 ) { global $paged; if ( ! is_single() ) { if ( ! $paged ) { $paged = 1; } $nextpage = (int) $paged + 1; if ( ! $max_page || $max_page >= $nextpage ) { return get_pagenum_link( $nextpage ); } } }
function get_next_posts_page_link( $max_page = 0 ) {
	global $paged;

	if ( ! is_single() ) {
		if ( ! $paged ) {
			$paged = 1;
		}
		$nextpage = (int) $paged + 1;
		if ( ! $max_page || $max_page >= $nextpage ) {
			return get_pagenum_link( $nextpage );
		}
	}
}

常見問題

FAQs
檢視更多 >