我创建了一个获取主题url的短代码,用于获取主题特定的图像,js和css。结果页面url成功打印在页面上,但是当我在herf或src上使用短代码时,它打印短代码名称而不是url。例如,
[theme_uri]
<link rel="stylesheet" type="text/css" href="[theme_uri]css/custom-landing.css"/>
输出 http://www.example.com/wp-content/themes/modular-child/
<link rel="stylesheet" type="text/css" href="[theme_uri]css/custom-landing.css">
我使用wordpress模块化框架,这个问题只发生在几个页面。
试试这个,
<link rel="stylesheet" type="text/css" href=[theme_uri]"css/custom-landing.css">