Welcome to ManageWP.org

Register to share, discuss and vote for the best WordPress stories every day, find new ideas and inspiration for your business and network with other members of the WordPress community. Join the #1 WordPress news community!

×

Enqueuing Scripts Only When Widget Or Shortcode Is Present

thewpcrowd.com | Oct. 27, 2016 | 6 min read

WordPress developers really value loading scripts responsibly. But when you’re building a widget or a shortcode you don’t know where on the site it will be used. This article walks you through exactly how to enqueue your scripts and styles only if your widget or shortcode is present on the page.

12 votes   Flag
Donna Cavalier

Great article. Thanks.

Reply
Matt Cromwell

Thanks for sharing!

Reply