WordPress Functions.php file loading bootstrap, jQuery and a local Library
function my_js_scripts() {
/**
* Use latest jQuery and bootstrap Libs
*/
if( !is_admin() ){
wp_deregister_script('jQuery');
wp_deregister_script('bootstray');
wp_deregister_script('localLib');
wp_register_script('jQuery', "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js");
wp_enqueue_script('jQuery');
wp_register_script('bootstrab', "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js");
wp_enqueue_script('bootstrab');
/* local Lib depends heavily on Jquery - 3rd. param */
wp_enqueue_script('localLib', get_stylesheet_directory_uri().'/scripts/myJSLib.js', array('jquery'),'0.9', false );
wp_enqueue_script('localLib');
}
}
function my_css_style() {
/* wp_enqueue_style( 'style-name', get_stylesheet_uri() ); //This is for getting style.css of current theme */
wp_register_style( 'cssStyles', get_template_directory_uri() .'css/genericCSS.css');
wp_enqueue_style( 'cssStyles' );
wp_register_style( 'bootstrapStyles', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
wp_enqueue_style( 'bootstrapStyles' );
}
add_action( 'wp_enqueue_scripts', 'my_js_scripts' );
add_action( 'wp_enqueue_scripts', 'my_css_style' );