get_stylesheet_directory

函数
get_stylesheet_directory ( No parameters )
返回值
  • (string) Path to active theme's stylesheet directory.
定义位置
相关方法
get_stylesheet_directory_uriget_stylesheet_uriget_stylesheetget_template_directoryregister_theme_directory
引入
1.5.0
弃用
-

get_stylesheet_directory: 这个函数检索到当前主题的样式表目录的路径。它不接受任何参数,并以字符串的形式返回路径。

检索活动主题的样式表目录路径。

function get_stylesheet_directory() {
	$stylesheet     = get_stylesheet();
	$theme_root     = get_theme_root( $stylesheet );
	$stylesheet_dir = "$theme_root/$stylesheet";

	/**
	 * Filters the stylesheet directory path for the active theme.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_dir Absolute path to the active theme.
	 * @param string $stylesheet     Directory name of the active theme.
	 * @param string $theme_root     Absolute path to themes directory.
	 */
	return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 19:32:59

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: