php - 链接中的wordpress template_directory - php
问题描述
在 wordpress 中,我尝试使用给定template_directory()
的链接语法。
如果我使用根目录的完整路径,它可以工作。
$ptthlider_img_second = '/wp/wp-content/themes/theme_name/inc/img/front_slider/slide2.jpg';
我希望的目标是template_directory
用于访问jpg
.
$ptthlider_img_first = template_directory() . '/inc/img/front_slider/slide1.jpg';
你有什么结论可以帮助我吗?
谢谢和最好的问候,丹尼斯
解决方案
使用get_template_directory()
get_template_directory 文档
推荐阅读
- docker - docker 在 windows 服务器核心容器上显示 windows 应用程序
- python - 如何使这个子图在 Python 中工作?
- python - Spyder reports invalid alias when running any script
- java - 嵌套异常是 com.ibatis.common.jdbc.exception.NestedSQLException:
- laravel - how to use laravel Scope in a relationship?
- xml - XSLT 文件 - for-each 函数的问题
- angular - 在 Angular 应用程序中使用 Kendo UI 和 NGX Bootstrap
- java - Vowels and Consonants with Regular Expression
- macos - 在 Mac 上使用 Docker 构建 Hyperledger Fabric
- javascript - 在 js 中保存/加载变量