Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
get_theme_file_path() - 检索主题中文件的路径 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_theme_file_path()

get_theme_file_path( string $file = '' )

检索主题中文件的路径


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 4 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "4a75aeb879471a176496188a632a5785" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "63a0eb98eacd47738d7ff00f479a4833" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "3a41fd57de8104db46dad2693d7f2deb" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

file

path

theme 主题more...


描述

在模板目录之前搜索样式表目录,因此从父主题继承的主题可以只覆盖一个文件。


参数

$file

(string) (可选) 要在样式表目录中搜索的文件。

默认值: ''


返回

(string) 文件的路径。



源码

查看源码 官方文档


更新日志

版本描述
4.7.0开始引入

使用示例

  • 示例1

    我们可以使用此函数允许子主题覆盖父主题的函数文件。

    get_theme_file_path( '/inc/template-functions.php' );

    谢谢