Created
February 27, 2017 01:57
-
-
Save Kaiderella/bfc099fa078b29f4b2b239939e3a0ab2 to your computer and use it in GitHub Desktop.
Chuyển JS xuống Footer trong WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Move JavaScript to the Footer | |
function remove_head_scripts() { | |
remove_action('wp_head', 'wp_print_scripts'); | |
remove_action('wp_head', 'wp_print_head_scripts', 9); | |
remove_action('wp_head', 'wp_enqueue_scripts', 1); | |
add_action('wp_footer', 'wp_print_scripts', 5); | |
add_action('wp_footer', 'wp_enqueue_scripts', 5); | |
add_action('wp_footer', 'wp_print_head_scripts', 5); | |
} | |
add_action( 'wp_enqueue_scripts', 'remove_head_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment