Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Add our function to the wp_head. You can also use wp_print_scripts.
- add_action( 'init', 'add_our_scripts',0);
- function add_our_scripts() {
- if (!is_admin()) { // Add the scripts, but not to the wp-admin section.
- // Adjust the below path to where scripts dir is, if you must.
- $scriptdir = get_bloginfo('template_url')."";
- // Remove the wordpresss inbuilt jQuery.
- wp_deregister_script('jquery');
- // Lets use the one from Google AJAX API instead.
- wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', false, '1.7.2');
- // Register the Superfish javascript file
- wp_register_script( 'superfish', $scriptdir.'/js/superfish.js', false, '1.4.8');
- // Now the superfish CSS
- wp_register_style( 'superfish-css', $scriptdir.'/css/superfish.css', false, '1.4.8');
- //load the scripts and style.
- wp_enqueue_script('jquery');
- wp_enqueue_script('superfish');
- wp_enqueue_style('superfish-css');
- } // end the !is_admin function
- } //end add_our_scripts function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement