How to add a custiomized javascipt into a template

Register the script first, then ask WP to enqueue it : function add_my_script() { wp_register_script(‘av_s’, get_template_directory_uri() . ‘/js/av_s.js’, array(‘jquery’)); wp_register_script(‘jquery’, ‘//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js’, array(‘jquery’),’1′, true); wp_enqueue_script(‘av_s’); wp_enqueue_script(‘jquery’); } add_action( ‘wp_enqueue_scripts’, ‘add_my_script’ ); Returns in <head>: <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/184882/{sitename}/wp-content/themes/twentytwelve/js/av_s.js?ver={version}”></script>

Target WooCommerce submit button

Please copy the woo-commerce checkout.js and paste in your theme folder and add following code in your function.php and after then you can change the checkout.js from your them. function so_27023433_disable_checkout_script(){ wp_dequeue_script( ‘wc-checkout’ ); wp_enqueue_script(‘checkout’, get_template_directory_uri() . ‘/js/checkout.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘so_27023433_disable_checkout_script’ );

jQuery no conflict

I prefer this: (function($){ “use strict”; $(document).ready(function(){ $(‘.flexslider’).flexslider({ slideshow: true, animationSpeed: 400, initDelay: 100, animation: “slide”, animationLoop: true, itemWidth: 258, itemMargin: 26 }); }); })(this.jQuery);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)