通过短代码使插件运行
许多插件需要将一些[短代码]放置在页面中,有时放置在循环内。但通常它只会使实际的[短代码]出现在我放置它的位置,而没有其他任何东西!
例如,这样那样的联系表单插件要求我将[联系表单插件]放在我的联系页面中,我应该看到一个表单出现在那里,但我却看到一个空白页面,其中出现了短代码。
我对 WordPress 比较陌生,所以这个问题听起来一定很愚蠢,但有人能耐心地向我解释一下吗?
Many plugin need some [shortcode] to be placed in a page, sometimes within the loop. But usually it only makes the actual [shortcode] appear where I placed it and nothing else !
For example such and such contact form plugin asks me to put [contact form plugin] in my contact page and I'm supposed to see a form appearing there as a result, but instead I see a blank page with the shortcode appearing.
I'm relatively new to WordPress so this question must sound stupid, stil can anybody take the pain to explain to me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,[短代码]旨在在循环内出现或操作。如果您希望它显示在其外部(例如,在侧边栏或页脚上),您需要手动计算它的值。
为此,您可以使用 do_shortcode() 函数:
AFAIK, [shortcode] is intended to be appeared or operated within the loop. if you want it to display outside it (says, on sidebar, or on footer) you need to manually compute it's value.
To do that, you can use do_shortcode() function: