0

Here is my file. My wordpress is 4.5

===============================
    FRONT-END ENQUEUE FUNCTIONS
===============================
*/
function sunset_load_scripts(){

wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.7', 'all' );
wp_enqueue_style( 'sunset', get_template_directory_uri() . '/css/sunset.css', array(), '1.0.0', 'all' );

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery' , get_template_directory_uri() . '/js/jquery.js', false, '1.11.3', true );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.7', true );

}
add_action( 'wp_enqueue_scripts', 'sunset_load_scripts' );
  • 2
    what is the problem ? – mmm Sep 7 '16 at 15:17
1

The proper way to wp_enqueue_script is :


wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js', array(), '1.11.3', true);


The last parameter is $in_footer set it true which will insert the script into the footer.

Note: You don't need to include jquery bcz by default it is added in WordPress.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.