5ucms论坛

标题: get_theme_file_path()函数 获取当前主题路径 [打印本页]

作者: admin    时间: 2021-6-3 16:19
标题: get_theme_file_path()函数 获取当前主题路径
get_theme_file_path()函数可以用来引入主题中某个文件,也就是说你想找到主题中某个文件,可以用此函数来查找。
语法

  1. get_theme_file_path( string $file = '' )
复制代码

参数

$文件 (字符串) (可选) 要在样式表目录中搜索的文件。默认值: ”

返回值

文件的路径

实例

  1. require_once get_theme_file_path() .'/inc/functions.php';
  2. //这段代码将加载主题文件夹下的inc文件夹下的functions.php文件
复制代码






欢迎光临 5ucms论坛 (http://bbs.5ucms.com/) Powered by Discuz! X3.2