【发布时间】:2014-05-25 15:10:47
【问题描述】:
我是 wordpress 新手。我在我的 wordprees 网站中添加了一些静态页面。在动态页面中,我们可以通过 bloginfo('template_directory');但它不适用于静态页面。那么此代码用于静态页面的替代方法是什么。
【问题讨论】:
标签: wordpress url static themes
我是 wordpress 新手。我在我的 wordprees 网站中添加了一些静态页面。在动态页面中,我们可以通过 bloginfo('template_directory');但它不适用于静态页面。那么此代码用于静态页面的替代方法是什么。
【问题讨论】:
标签: wordpress url static themes
你可以使用一点 Javascript:
location.pathname
【讨论】:
当然!使用这个功能:
http://codex.wordpress.org/Function_Reference/get_template_directory_uri
如果您有任何其他问题,请告诉我。
【讨论】:
我的问题已经解决了,谢谢回复。我使用简码在页面中获取主题链接
//[主题网址] 函数主题url_func($atts){
return bloginfo('template_directory');
} add_shortcode('themeurl', 'themeurl_func');
只需在页面中写入 [themeurl] 我们就可以在页面中获取主题网址
【讨论】: