Home › Forums › All Other Themes › Performance issues with Bakery Pro Theme
- This topic has 3 replies, 2 voices, and was last updated 8 years, 10 months ago by Sonl Sinha.
-
AuthorPosts
-
February 4, 2016 at 11:27 am #21469
Hi there,
I’m getting fairly slow loading times with the Bakery Pro theme. After running a diagnostic, I see that there a quite a lot of scripts running, some of which don’t appear to be necessary (see https://gtmetrix.com/reports/youngblooms.co.uk/iTak0Bhs) Image sizes should also been specified, and while I can do this for the on-page images, I’m not sure how to do this for the slider images.
Is it possible to disable some of the scripts (e.g. the vimeo) that aren’t needed. Could you offer advice on how to improve the loading time?
Thanks,February 4, 2016 at 11:29 am #21470Alternatively, is it possible to defer the script loading, so that page performance isn’t affected so adversely?
February 4, 2016 at 10:26 pm #21530It’s ok, I have been able to defer the scripts from loading by adding the following to the end of functions.php:
// Defer Javascripts // Defer jQuery Parsing using the HTML5 defer property if (!(is_admin() )) { function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; // return "$url' defer "; return "$url' defer onload='"; } add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); }
For anyone else wondering how to prevent the ‘jump’ that happens when the images for the slider load, the following change can also be made in functions.php:
Change
<?php if ( (of_get_option('innerpageslider', true) != 'hide') || is_home() || is_front_page() ) { ?> jQuery(window).load(function() { jQuery('#slider').nivoSlider({
to
<?php if ( (of_get_option('innerpageslider', true) != 'hide') || is_home() || is_front_page() ) { ?> jQuery(function() { jQuery('#slider').nivoSlider({
This will make the slider appear as soon as the first image has loaded, rather than wait for them all to load
February 5, 2016 at 5:25 am #21552Hi Stuart,
Thanks for the info. We appreciate your help.
Regards,
Shri -
AuthorPosts
- You must be logged in to reply to this topic.