Im trying to load the flexslider.ls file in the footer of frontpage, it just loaded Jquery only, without flexsilder.js I tried through full path
// Load the Theme JS
function theme_js() {
wp_register_script( 'flexslider', get_template_directory_uri() . '/localhost/gerboni.lv/wp-content/themes/CoatOfArms/js/flexslider.js', array('jquery'), '', true );
if ( is_front_page() ) {
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' );
add_action( 'wp_enqueue_scripts', 'theme_styles' );
after the path
// Load the Theme JS
function theme_js() {
wp_register_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.js', array('jquery'), '', true );
if ( is_front_page() ) {
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' );
add_action( 'wp_enqueue_scripts', 'theme_styles' );
did not work. And then the source is giving me completely different path to the file:
<script type='text/javascript' src='http://localhost/gerboni.lv/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
and
<script type='text/javascript' src='http://localhost/gerboni.lv/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
Hope its not too messy.
jquery-migrate
and the second block of code is correct, assuming it is meant to load the script from the current theme directory. Something is mangling your file loading. It is impossible to tell what though.