Tagged: x
-
AuthorPosts
-
July 22, 2016 at 5:30 am #1098442
Hi,
Is it possible to dequeue the scripts for Google Fonts and Renew? I want to combine the CSS from these scripts into one file to improve my Google PageSpeed and loading time.
I have sorted out all of the other CSS scripts except for the following:
– https://www.teachtutti.com/wp-content/themes/x/framework/css/dist/site/stacks/renew.css
– https://fonts.googleapis.com/css?family=Lato:300,300italic,700,700italic,900,400%7CPacifico:400&subset=latin,latin-ext,latin,latin-extI’ve now combined these CSS scripts into the main theme styling file (Appearance – Customise – Custom – Edit Global CSS). However, I can’t stop this callout from happening.
My domain is teachtutti.com.
Thanks,
Liam
July 22, 2016 at 7:51 am #1098553Hi Liam,
You can try adding this code in your child theme’s functions.php file.
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 ); function remove_default_stylesheet() { $google_fonts_request = x_cache_google_fonts_request(); if ( $google_fonts_request != '' ) { wp_dequeue_style( 'x-google-fonts', $google_fonts_request, NULL, X_VERSION, 'all' ); } wp_deregister_style( 'x-stack', X_TEMPLATE_URL . '/framework/css/dist/site/stacks/renew.css', NULL, X_VERSION, 'all' ); }
Hope that helps
July 22, 2016 at 11:19 am #1098760Hi Paul,
Thanks for your reply. I’m afraid I’ve tried this and it hasn’t seemed to work.
Updated functions.php file: http://www.teachtutti.com/wp-content/uploads/2016/07/Updated-functions.jpg
Latest Page Speed report: http://www.teachtutti.com/wp-content/uploads/2016/07/Page-Speed.jpg
I gave it a while before checking again with Page Speed so I’m confident that they were reviewing the latest cache.
Best wishes,
Liam
July 22, 2016 at 1:09 pm #1098931That’s great!
If you have any further queries, do let us know. We’d be happy to assist you with everything!
Thanks.
July 22, 2016 at 3:02 pm #1099078Hi Rahul,
Sorry, I said that this didn’t have an effect on the scripts being displayed. They aren’t being dequeued and are still showing up as normal.
Best,
Liam
July 22, 2016 at 9:52 pm #1099473Hey Liam,
Are you using CloudFlare or may have installed a caching plugin like WordFence, W3 Total Cache or WP Super Cache? Please keep in mind that after doing every updates or theme changes, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.
Please let us know how it goes.
July 23, 2016 at 7:14 am #1099764Hi Rue,
Thanks very much for this, I completely forgot to clear the cache. It works perfectly!
Cheers 🙂
Liam
July 23, 2016 at 7:20 am #1099766Glad it worked 🙂
If you need anything else please let us know.
-
AuthorPosts