From 4ff905c2c6e1e457e53c88eec6543ee0b0002dce Mon Sep 17 00:00:00 2001 From: AlxMedia Date: Wed, 9 Mar 2022 16:49:39 +0100 Subject: [PATCH] Fixed featured flexslider not loading images, disable native lazy load --- functions.php | 8 +++++++- readme.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 7292028..ec28e3c 100644 --- a/functions.php +++ b/functions.php @@ -826,4 +826,10 @@ add_action( 'wp_print_footer_scripts', 'curver_skip_link_focus_fix' ); /* Disable wp lazy load, fix for flexslider /* ------------------------------------ */ -add_filter('wp_lazy_loading_enabled', '__return_false'); \ No newline at end of file +add_filter('wp_lazy_loading_enabled', '__return_false'); + +function curver_disable_lazy_load_featured_images($attr, $attachment = null) { + $attr['loading'] = 'eager'; + return $attr; +} +add_filter('wp_get_attachment_image_attributes', 'curver_disable_lazy_load_featured_images'); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 6ef8083..791a887 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,7 @@ Sidebar images = 1.2.4 - 2022-01-24 = * Updated to Kirki 4.0 +* Fixed featured flexslider not loading images, disable native lazy load = 1.2.3 - 2021-08-25 = * Added missing theme tags for wordpress.org