Advertisement
kennyvb

functions.php

May 28th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. //Add our function to the wp_head. You can also use wp_print_scripts.
  2. add_action( 'init', 'add_our_scripts',0);
  3.  
  4. function add_our_scripts() {
  5.  
  6.     if (!is_admin()) { // Add the scripts, but not to the wp-admin section.
  7.     // Adjust the below path to where scripts dir is, if you must.
  8.     $scriptdir = get_bloginfo('template_url')."";
  9.  
  10.     // Remove the wordpresss inbuilt jQuery.
  11.     wp_deregister_script('jquery');
  12.  
  13.     // Lets use the one from Google AJAX API instead.
  14.     wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', false, '1.7.2');
  15.     // Register the Superfish javascript file
  16.     wp_register_script( 'superfish', $scriptdir.'/js/superfish.js', false, '1.4.8');
  17.     // Now the superfish CSS
  18.     wp_register_style( 'superfish-css', $scriptdir.'/css/superfish.css', false, '1.4.8');
  19.  
  20.     //load the scripts and style.
  21.     wp_enqueue_script('jquery');
  22.     wp_enqueue_script('superfish');
  23.     wp_enqueue_style('superfish-css');
  24.     } // end the !is_admin function
  25. } //end add_our_scripts function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement