Conditionally Adding Scripts and Styles if Shortcode present
I noticed that with many plugins, they include scripts and stylesheets in the header even if the shortcode is never used, or not used on the current page. Since this adds to the HTTP requests unnecessarily, I am trying to figure out how to conditionally include the scripts and stylesheets only if the shortcode is present.
The shortcodes are registered with:
Do any of you have a solution to this?
Thanks in advance!
- The topic ‘Conditionally Adding Scripts and Styles if Shortcode present’ is closed to new replies.