Love Mt. Pleasant Web Design Non Profit Church
April 15, 2010How to Properly Include Scripts in WordPress
April 15, 2010How to Properly Include Scripts in WordPress
<?php
wp_enqueue_script(‘name the script whatever you want’, ‘the source of the script the url destination’,any dependents or scripts this script needs to work you need to use an array( ‘script one’, ‘script two’) for multiple dependencies,’the version of the script 1.2′) ;
?>
note: use false if the script has no dependents
a wp enqueue script should look like this:
<?php
wp_enqueue_script(‘easing’, ‘/wp-content/themes/themeNane/js/jquery.easing.1.2.js’,false,’1.2′) ;
wp_enqueue_script(‘anything-slider’, ‘/wp-content/themes/themeNane/js/jquery.anythingslider.js’,false,’1.2′) ;
wp_enqueue_script(‘stepcarousel’, ‘/wp-content/themes/themeNane/js/stepcarousel.js’, array( ‘jquery’)) ;
wp_enqueue_script(‘lTabs’, ‘/wp-content/themes/themeNane/js/lTabs.js’, array( ‘jquery-ui-core’, ‘jquery-ui-tabs’)) ;
wp_enqueue_script(‘lightbox’, ‘/wp-content/themes/themeNane/js/jquery.lightbox-0.5.js’,false, ‘0.5’);
wp_head();
?>