get_previous_posts_page_link

函式
get_previous_posts_page_link ( No parameters )
返回值
  • (string|void) The link for the previous posts page.
定義位置
相關方法
get_previous_posts_linkget_previous_post_linkget_previous_image_linkget_next_posts_page_linkprevious_posts_link
引入
2.0.10
棄用
-

get_previous_posts_page_link函式是一個WordPress函式,用於檢索特定查詢的前一頁文章的連結: 這個函式接受一個可選引數作為連結文字,並返回到前一頁文章的連結。

檢索以前的文章頁面連結。

如果不是在一個頁面或文章上,將只返回字串。

從2.1.3回傳到2.0.10。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_previous_posts_page_link() {
global $paged;
if ( ! is_single() ) {
$nextpage = (int) $paged - 1;
if ( $nextpage < 1 ) {
$nextpage = 1;
}
return get_pagenum_link( $nextpage );
}
}
function get_previous_posts_page_link() { global $paged; if ( ! is_single() ) { $nextpage = (int) $paged - 1; if ( $nextpage < 1 ) { $nextpage = 1; } return get_pagenum_link( $nextpage ); } }
function get_previous_posts_page_link() {
	global $paged;

	if ( ! is_single() ) {
		$nextpage = (int) $paged - 1;
		if ( $nextpage < 1 ) {
			$nextpage = 1;
		}
		return get_pagenum_link( $nextpage );
	}
}

常見問題

FAQs
檢視更多 >