0
votes

I have jQuery loaded to my WordPress site through google CDN using wp_enqueue_script():

function my_jquery_enqueue(){  
  wp_deregister_script('jquery');
  wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", false, null);
  wp_enqueue_script('jquery');    
}
if (!is_admin()) add_action('wp_enqueue_scripts', 'my_jquery_enqueue',11); 

Now I need to use wp_enqueue_script to load twitter-bootstrap's script file so I can use it, but for some reason it's not loading into my theme.

function my_twitterBootstrap_js(){   
    wp_enqueue_script('twitter-bootstrap-js', 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js', array('jQuery'));
}
add_action('wp_enqueue_scripts', 'my_twitterBootstrap_js');

By the way, I am using Thesis 1.8.5 theme.

Did I do something wrong here?

1

1 Answers

0
votes

I see that you are trying to load this script on the admin side. Is that correct? If so then use: admin_enqueue_scripts.

If you are not trying to load it on the admin, then get rid of !is_admin() in your code above.