Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Moving JS to footer

Home / Forums / Virtue Theme / Moving JS to footer

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
November 5, 2015 at 7:36 pm

Hello Ben,

I tried to move JS to footer just to speed my site, but I got some syntax error and slider didn’t work…I know it is logical because slider use also JS, but is there any solution?

I used this code in my function.php

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’ );

Thank You

Many Greetings

Satoko T

  • The forum ‘Virtue Theme’ is closed to new topics and replies.