I'm trying to insert the flexslider.js and theme.js using functions.php. However, it doesn't load the flexslider.js and theme.js files when I view the source file.
I've downloaded the flex slider files and inserted jquery.flexslider-min.js as js/flexslider.js.
Functions.php
// Load the Theme JS
function theme_js() {
wp_register_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.js', array('jquery'), '', true );
if( is_page( 'home' ) ) {
wp_enqueue_script( 'flexslider' );
}
wp_enqueue_script('theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery'), '', true );
}
add_action( 'wp_enqueue_scripts', 'theme_js' );
Theme.js
jQuery(document).ready(function($) {
$('.flexslider').flexslider();
});
Scripts from the source file
<script type='text/javascript' src='http://localhost:8888/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
<script type='text/javascript' src='http://localhost:8888/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>