pifa

Include scripts in function.php WordPress

Nov 27th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. function load_my_scripts() {
  2.  
  3.     //Include WP jQuery
  4.     wp_enqueue_script('jquery');
  5.    
  6.     //Include custom.js
  7.     wp_register_script('myscript', get_bloginfo('template_url').'/js/custom.js', array('jquery'), '1.0', true );
  8.     wp_enqueue_script('myscript');
  9.    
  10.     //Include bxSlider
  11.     wp_register_script('bxslider', get_bloginfo('template_url').'/js/jquery.bxslider.min.js', array('jquery'), '1.0', true );
  12.     wp_enqueue_script('bxslider');
  13.    
  14.    
  15.     //Include selectbox
  16.     wp_register_script('selectbox', get_bloginfo('template_url').'/js/jquery.selectbox-0.2.min.js', array('jquery'), '1.0', true );
  17.     wp_enqueue_script('selectbox');
  18.  
  19.     //Include zoom plugin
  20.     wp_register_script('zoom', get_bloginfo('template_url').'/js/jquery.jqzoom-core-pack.js', array('jquery'), '1.0', true );
  21.     wp_enqueue_script('zoom');
  22.  
  23.     //Include masonry
  24.     wp_register_script('masonry', get_bloginfo('template_url').'/js/jquery.masonry.min.js', array('jquery'), '1.0', true );
  25.     wp_enqueue_script('masonry');
  26.  
  27.    
  28.    
  29. }
  30.  
  31. add_action('wp_enqueue_scripts', 'load_my_scripts');
Advertisement
Add Comment
Please, Sign In to add comment