Load plugin’s CSS file only when widget is used
-
Hi.
In order to load the CSS file only when the widget is used, please change the function ESR_Official_Widget_for_wordpress_custom_Styling() into:function ESR_Official_Widget_for_wordpress_custom_Styling(){ if ( is_active_widget( false, false, 'ersradio-widget', true ) ) { // Register my custom stylesheet wp_register_style('volumeSliderStyling', plugins_url('ersradio-widget/widgetStyling.css')); // Load my custom stylesheet wp_enqueue_style('volumeSliderStyling'); } }
- The topic ‘Load plugin’s CSS file only when widget is used’ is closed to new replies.