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_parent_theme_file_path() - 检索父主题中文件的路径 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_parent_theme_file_path()

get_parent_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 5 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 "36030fe78ffd20bf6a789fd4064807d0" 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

parent

path

theme 主题more...


参数

$file

(string) (可选) 要在模板目录中返回路径的文件。

默认值: ''


返回

(string) 文件的路径。



源码

查看源码 官方文档


更新日志

版本描述
4.7.0开始引入

使用示例

  • 示例1

    在functions.php或任何其他文件中 include/require PHP文件的正确方式。

    require get_parent_theme_file_path( '/inc/your-file-name.php' );