How to only load scripts if WordPress Widget is Active

26
Apr

Have you ever wanted to load certain scripts depending on whether a widget is being displayed? Using the WordPress is_widget_active we can run a check to check if the widget is being displayed and load the relevant scripts.