Archived topic
Remove Jquery
9 replies · Started by Farhan on September 21, 2017
For a project I want to remove jquery from frontend and usually the following code would do that but since some of the generatepress modules use it it still loads.
is there any way to remove it even if it breaks stuff for now without editing any core files?
add_filter( 'wp_default_scripts', 'change_default_jquery' );
function change_default_jquery( &$scripts){
if(!is_admin()){
$scripts->remove( 'jquery');
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' );
}
}
Hi there,
The next version of GP doesn't use jQuery. You can download the beta on our GitHub page: https://github.com/tomusborne/generatepress
Awsome, When's the estimated official release and does the auto update work from beta?
Thank yoU!
Likely a couple weeks. Yes, you'll still receive Dashboard updates if you install the beta :)
Awesome going too install in that case!
Awesome, let me know if you run into any problems :)
Hi Tom,
I am also looking to disabling jquery on my website. Has this feature already been implemented in the newest release version or is it still in beta?
@John
The 2 version of the theme has already removed jquery. Pretty awesome! checkout the details at https://generatepress.com/generatepress-2-0/
Thanks.
Looks like it is updated on the theme but I use the GP Premium plugin and whenever I have it activated, it is loading jquery. Is there any workaround for that?
Certain elements in GP Premium still require jQuery. We'll be slowly converting them to vanilla javascript as time/technology allows.
For example, the slideout navigation will be using vanilla js soon.
Things like the sticky menu or masonry will still require jQuery going forward.