Conditional Script Loading for Shotcode

In the functions.php file or in your plugin file write the code below – [php] /** * Check if it should load frontend scripts * * @return mixed|void */ private function should_load_scripts() { global $post; $load_scripts = is_active_widget( false, false, ‘wpl_logo_carousel_pro_widget_content’, true ) || ( is_a( $post, ‘WP_Post’ ) && has_shortcode( $post->post_content, ‘logo-carousel-pro’ ) ); …

Conditional Script Loading for Shotcode Read More »