WordPress 常用的路径
WordPress 开发文档
收录了这篇文章

1, bloginfo(‘template_url’)

输出:http://localhost/wordpress/wp-content/themes/mytheme


2, bloginfo(‘template_directory’)

输出:http://localhost/wordpress/wp-content/themes/mytheme


3, get_template_directory_uri()

输出:http://localhost/wordpress/wp-content/themes/mytheme


4, get_stylesheet_directory_uri()

输出:http://localhost/wordpress/wp-content/themes/mytheme


5, get_template_directory()

输出:/www/test_com/wordpress/wp-content/themes/mytheme


6, home_url();

输出:http://localhost/wordpress


7, site_url()

输出:http://localhost/wordpress


8, plugins_url()

输出:http://localhost/wp-content/plugins


9, plugins_url('my-dir')

输出:http://localhost/wp-content/plugins/my-dir


10,plugin_dir_path(__FILE__ );

输出:/home/user/public_html/wp-content/plugins/myplugin/



修改时间 2023-12-23

声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。
随机推荐
JavaScript EventSource 服务器发送事件 Server-Sent Events(SSE)
WordPress 函数 add_option()、get_option() 和 update_option()
JavaScript Proxy 代理
Nginx 使用 Njs 授权访问文件
Node.js 模块概念
WordPress 一键从HTTP转换到HTTPS
WordPress 后台添加菜单
RESTful API 执行 delete 返回204无法获取 Body