• Resolved kghugo2000

    (@kghugo2000)


    Hi,

    I am wondering how can I move all minified js script to the footer? I have tried using this code but the minified js script still stayed in the header.

    // Custom Scripting to Move JavaScript from the Head 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’ );
    
    // END Custom Scripting to Move JavaScript

    Thank you for your help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I move all minified js script to footer’ is closed to new replies.