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.com/


1 Answer 1


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.

  • Thanks for this, how would I get the HTML from the shortcode that a plugin creates?
    – gjjr
    Apr 24, 2020 at 4:18
  • Add the shortcode in a WordPress post or page. Then view the page on the front end and use the Inspector to see the HTML.
    – WebElaine
    Apr 24, 2020 at 15:45
  • (You may need to check and see if any other files are output with the HTML - like JS or CSS that would affect how it works or how it looks.)
    – WebElaine
    Apr 24, 2020 at 15:46
  • ive solved this now thanks guys!
    – gjjr
    Apr 25, 2020 at 10:24
  • If this answer helped please select it - and if you solved it some other way please write your own answer so others searching for something similar know what worked for you. :)
    – WebElaine
    Apr 27, 2020 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.