最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to add shortcode to HTML file (not showing on website)

programmeradmin4浏览0评论

Im trying to add a plugin shortcode into an HTML document so that when you clickthe "Music" icon on the site a popup appears with the plugin widget in it.

This is the shortcode in the HTML file (using the plugin "Custom CSS & JS), ive wrapped it in a div, it works with an iframe but I cant get a shortcode to appear.

   [lbg_audio3_html5 settings_id='1']

This is the page - /

Im trying to add a plugin shortcode into an HTML document so that when you clickthe "Music" icon on the site a popup appears with the plugin widget in it.

This is the shortcode in the HTML file (using the plugin "Custom CSS & JS), ive wrapped it in a div, it works with an iframe but I cant get a shortcode to appear.

   [lbg_audio3_html5 settings_id='1']

This is the page - https://ellislanding.garywestjr/

Share Improve this question asked Apr 23, 2020 at 11:26 gjjrgjjr 1134 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

Shortcodes work because WordPress is set up to parse them when it outputs content. Including a shortcode in any plain HTML file won't work because there's nothing but the web browser to parse the code.

It's possible to include some WP methods - such as in this question What is the correct way to use WordPress functions outside WordPress files? - but you'd likely be better off just taking the full HTML the shortcode outputs and pasting that into your file, rather than trying to bootstrap WP into HTML.

发布评论

评论列表(0)

  1. 暂无评论