在 WordPress 中查找短代码
H
当在加载的页面上找到 [slideshow] 短代码时,我希望能够向我的 BODY 标记添加附加类?这可能吗?
谢谢
H
I want to be able to add an addition class to my BODY tag when the [slideshow] shortcode is found on the page that is loading? Is this possible?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,这是可能的。将以下代码添加到主题的functions.php中,并将'your-custom-body-class'替换为您想要为带有[slideshow]短代码的帖子和页面添加的实际类名。
Sure, it's possible. Add the following code to functions.php of your theme, and replace 'your-custom-body-class' with the actual class name you want to add for posts and pages with [slideshow] shortcode.