/ Published in: PHP
goes in the functions file
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * WordPress Sample function and action * for loading scripts in themes */ // Let's hook in our function with the javascript files with the wp_enqueue_scripts hook add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' ); // Register some javascript files, because we love javascript files. Enqueue a couple as well function wpcandy_load_javascript_files() { wp_deregister_script( 'jquery'); wp_register_script( 'jquery', get_template_directory_uri().'/js/jquery-1.8.2.min.js', array(), '1.8.2', false ); wp_enqueue_script('jquery'); wp_register_script( 'jquery.flexslider', get_template_directory_uri().'/js/jquery.flexslider.js', array('jquery'), '1.7', false ); wp_enqueue_script('jquery.flexslider'); }
URL: http://codex.wordpress.org/Function_Reference/wp_enqueue_script