I am new to bootstrap and WordPress and trying to put together a simple page. So, it doesn't surprise me that I'm running into dependency problems adding and registering scripts from both the header and footer.
Is there anything obvious here that I'm missing?
<?php
function wpbootstrap_scripts_with_jquery() { // Register the script like this for a theme: wp_register_script( 'custom-script', get_template_directory_uri() . 'js/bootstrap.js', array( 'jquery' ) );
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/jquery.tweet.js', array( 'jquery' ) );
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/clock.js', array( 'jquery' ) );
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/soon.js', array( 'jquery' ) );
//footer scripts
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/dat.gui.min.js', array( 'jquery' ) );
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/fss.js', array( 'jquery' ) );
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . 'js/bgCustom.js', array( 'jquery' ) );
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script( 'custom-script' );
} add_action( 'wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery' );
?>
custom-script
, each call towp_register_script
overwrites the previous one. give them unique handles.