Please add support for a3 lazy Load for Home Page Custom image function
-
Hi Guys,
We have had a support ticket on which one your users @friendofmisery has posted this
a3 Lazy Load is working everywhere on the site except the home page. Have downloaded the theme and see that images are added by this custom function which means lazy load can’t find the images
function siteorigin_unwind_get_image() { $first_image = ‘’; $output = preg_match_all( ‘/<img[^>]+\>/i’, get_the_content(), $images ); $first_image = $images[0][0]; return ( ‘’ !== $first_image ) ? $first_image : false; }
It is not possible for us to add custom code for every different custom function that a developer might use – but if you wished we provide filters so that a3 lazy Load can be applied to your custom functions.
To fix the issue for your user and make your theme fully compatible with a3 lazy load would require just a small filter – if you would be willing to add it.
for example change
return ( ‘’ !== $first_image ) ? $first_image : false; to return ( ‘’ !== $first_image ) ? apply_filters( ‘a3_lazy_load_images’, $first_image, false ) : false;
Just for your reference here is a full list of filters that developers can be use for a3 lazy Load compatibility – but as i mentioned it is just your home page where the issue exists.
Apply filter tags to apply lazy load:
– a3_lazy_load_images : apply lazy load for images from content
Example code to use it: apply_filters( ‘a3_lazy_load_images’, $your_content, null );– a3_lazy_load_videos :apply lazy load for videos and iframe from content
Example code to use it: apply_filters( ‘a3_lazy_load_videos’, $your_content, null );– a3_lazy_load_html : apply lazy load for all images, videos and iframe from content
Example code to use it: apply_filters( ‘a3_lazy_load_html’, $your_content, null );Hard class name to exclude lazy load on images or videos , iframes from lazy load : a3-notlazy
Filter tags for add class name of theme to exclude lazy load on images or videos :
– a3_lazy_load_skip_images_classes
– a3_lazy_load_skip_videos_classesRegards
SteveThe page I need help with: [log in to see the link]
- The topic ‘Please add support for a3 lazy Load for Home Page Custom image function’ is closed to new replies.