How to Add Javascript Only When a Function Exists?
Hi @Denis Belousov: Okay, based on your responses I’m going to ask why tie it to the function existing, why not just test the return value of get_option(‘src_switcher’) like this? function my_scripts() { if (!is_admin()) { wp_enqueue_script(‘jquery’); wp_enqueue_script( ‘custom’, get_bloginfo(‘template_directory’).’/js/custom.js’, array( ‘jquery’ ), ”, true ); if (is_front_page()) { $sliders = get_option(‘src_switcher’); if ($sliders == … Read more