Basically, you’ll want to take all of those script tags out of your header file, and replace them with a function in your functions.php file. For, example this:
<script language="javascript" type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>
Could be replaced by adding this to functions.php:
function my_scripts_method() {
$jQuery = "https://code.jquery.com/jquery-latest.min.js";
wp_deregister_script( 'jQuery' );
wp_register_script( 'jQuery', $jQuery);
wp_enqueue_script( 'jQuery');
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
You can also use this one function to call multiple scripts.
this:
<?php if ( is_home() ) { // IF HOMEPAGE, LOAD SCRIPTS FOR SLIDERS ?>
<script language="javascript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jflow.plus.js"></script>
<script type="text/javascript" language="javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.carouFredSel-5.6.4-packed.js"></script>
<?php }
could be replaced with this:
function my_scripts_method() {
$jQuery = "https://code.jquery.com/jquery-latest.min.js";
wp_deregister_script( 'jQuery' );
wp_register_script( 'jQuery', $jQuery);
wp_enqueue_script( 'jQuery');
if ( is_home() ) { // IF HOMEPAGE, LOAD SCRIPTS FOR SLIDERS
$jflow= get_bloginfo('template_directory'); ?>/js/jflow.plus.js";
wp_deregister_script( 'jflow' );
wp_register_script( 'jflow', $jflow);
wp_enqueue_script( 'jflow');
$carouFredSel= get_bloginfo('template_directory'); ?>/js/jquery.carouFredSel-5.6.4-packed.js";
wp_deregister_script( 'carouFredSel' );
wp_register_script( 'carouFredSel', $carouFredSel);
wp_enqueue_script( 'carouFredSel');
}//end if
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
If you haven’t already come across it, take a look at this: https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers
hope that helps.