get_template

函式
get_template ( No parameters )
返回值
  • (string) Template name.
定義位置
相關方法
get_404_templateget_tag_templateget_home_templateget_date_templateget_page_template
引入
1.5.0
棄用
-

get_template: 這個函式檢索頁面的主要模板檔案的路徑。它不接受任何引數,以字串形式返回模板檔案的路徑。

檢索活動主題的名稱。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_template() {
/**
* Filters the name of the active theme.
*
* @since 1.5.0
*
* @param string $template active theme's directory name.
*/
return apply_filters( 'template', get_option( 'template' ) );
}
function get_template() { /** * Filters the name of the active theme. * * @since 1.5.0 * * @param string $template active theme's directory name. */ return apply_filters( 'template', get_option( 'template' ) ); }
function get_template() {
	/**
	 * Filters the name of the active theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $template active theme's directory name.
	 */
	return apply_filters( 'template', get_option( 'template' ) );
}

常見問題

FAQs
檢視更多 >