I want to add and load my scripts in a safe way. However, when the code is added to functions.php, nothing happens on the specific template.
<?php
function theme_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery2', 'http://code.jquery.com/jquery-latest.js' );
wp_enqueue_script( 'easing', get_template_directory_uri() . '/jquery.easing.1.3.js', 'jquery' );
}
add_action('init', 'theme_scripts');
?>
http://sandbox.jinoh.dk/charlotte/wordpress/wordpress/
I have read that it should be loaded into the template – index.php for example, like a normal etc, but there is nothing. What do I do wrong?
Make sure to call
wp_head()in your theme, typically in yourheader.phpfile.This checklist is excellent: WordPress Theme Development Checklist