get_front_page_template

函式
get_front_page_template ( No parameters )
返回值
  • (string) Full path to front page template file.
相關
  • get_query_template()
定義位置
相關方法
get_page_templateget_paged_templateget_page_templatesget_tag_templateget_page_template_slug
引入
3.0.0
棄用
-

get_front_page_template: 這個函式用來檢索當前WordPress主題的首頁模板檔案的路徑。前端頁面模板檔案用於顯示網站的靜態前端頁面。

檢索當前或父模板中的首頁模板路徑。

模板層次和模板路徑可以通過{@see ‘$type_template_hierarchy’}和{@see ‘$type_template’}動態鉤子過濾。和{@see ‘$type_template’}動態鉤子,其中`$type`是’frontpage’。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_front_page_template() {
$templates = array( 'front-page.php' );
return get_query_template( 'frontpage', $templates );
}
function get_front_page_template() { $templates = array( 'front-page.php' ); return get_query_template( 'frontpage', $templates ); }
function get_front_page_template() {
	$templates = array( 'front-page.php' );

	return get_query_template( 'frontpage', $templates );
}

常見問題

FAQs
檢視更多 >