Created
October 7, 2015 10:56
-
-
Save rajeebbanstola/4fa7f75a0a88c880aba0 to your computer and use it in GitHub Desktop.
Enqueue Scripts Only if widget is active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'colormag_scripts_styles_method' ); | |
/** | |
* Enqueues styles and scripts. | |
*/ | |
function colormag_scripts_styles_method() { | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
if(is_active_widget( '', '', 'colormag_category_post_slider')){ | |
wp_enqueue_script( 'colormag-bxslider', COLORMAG_JS_URL . '/jquery.bxslider' . $suffix . '.js', array( 'jquery' ), '4.1.2', true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment