the_post

函式
the_post ( No parameters )
定義位置
相關方法
write_posthave_postsget_postedit_postget_posts
引入
1.5.0
棄用
-

post是一個WordPress函式,用於在迴圈中設定當前文章。WordPress迴圈呼叫它來檢索當前文章,並設定各種全域性變數,如$post和$id。

在迴圈中迭代文章索引。

function the_post() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		return;
	}

	$wp_query->the_post();
}

常見問題

FAQs
檢視更多 >