get_singular_template

函式
get_singular_template ( No parameters )
返回值
  • (string) Full path to singular template file
相關
  • get_query_template()
定義位置
相關方法
get_single_templateget_search_templateget_query_templateget_index_templateget_tag_template
引入
4.3.0
棄用
-

get_singular_template函式是一個WordPress函式,用於檢索特定文章型別的單一文章模板檔案的路徑: 這個函式把文章型別作為引數,並返回到單一的文章模板檔案的路徑。

檢索當前或父模板中的單一模板的路徑。

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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_singular_template() {
return get_query_template( 'singular' );
}
function get_singular_template() { return get_query_template( 'singular' ); }
function get_singular_template() {
	return get_query_template( 'singular' );
}

常見問題

FAQs
檢視更多 >