• Resolved ondoheer

    (@ondoheer)


    For it to work with ACF wysiwygs and basic contwent types it just needs this line added to the

    class-a3-lazy-load.php file:

    if ( $a3_lazy_load_global_settings[‘a3l_apply_image_to_content’] == true ) {
    add_filter( ‘acf_the_content’, array( $this, ‘filter_content_images’ ), 10 );
    }

    Please do this upgrade so we ACF heavey users can all benefit with this!

    (Also add it for iframes and videos?)

    • This topic was modified 6 years, 11 months ago by ondoheer.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Steve Truman

    (@a3rev)

    Hi @ondoheer

    Thank you for this. I had no idea that there was even an issue with ACF wysiwygs and basic content types.

    Have not ever used that plugin so know nothing about it and of course don’t have access to the Premium (Heavy) version.

    As you have already taken the time to dig into the a3 lazy Load code to come up with a sample patch – would you mind submitting a PR for full compatibility with ACF ACF wysiwygs, basic contwent types, iframes and videos and any other pro version features?

    That would make getting this featured released so much faster and more comprehensive.

    Here is a link to the issue that I just created for it on the plugins git repo https://github.com/a3rev/a3-lazy-load/issues/14

    Of course we will credit you with the compatibility work for ACF

    Regards
    Steve

    Thread Starter ondoheer

    (@ondoheer)

    Of course, I tried to find the git repo but only found the SVN on your platform.

    Will do a PR for review today.

    Thread Starter ondoheer

    (@ondoheer)

    Done, thanks for a great plugin, it works flawlessly and is the only one that supports srcet. I am an optimization consultant and using Responsive images and lazy loading is vital to my work. Kudos on the great work!

    Plugin Author Steve Truman

    (@a3rev)

    @ondoheer

    I see your Git PR – Thanks for the speedy contribution.

    Steve

    Hi Steven,
    I installed the current version of the plugin but it seems that lazy loading is not working properly. I load images with the following code:

    $image2 = get_field('2_bild');
    // vars
    $url = $image2['url'];
    $title = $image2['title'];
    $alt = $image2['alt'];
    $caption = $image2['caption'];
    
    // thumbnail
    $size = 'berufe-thumb-big';
    $thumb2 = $image2['sizes'][ $size ];
    $width = $image2['sizes'][ $size . '-width' ];
    $height = $image2['sizes'][ $size . '-height' ];

    <img width="<? echo $width; ?>" height="<? echo $height; ?>" class="img-responsive" src="<? echo $thumb2; ?>" alt="<?php get_the_title(); ?>?">

    Is there anything wrong with that?

    Thread Starter ondoheer

    (@ondoheer)

    Hello Marius, might not have anything to do with the lazy loading part, but when you call on images like that, you are missing the WP functionality that creates the srcset and sizes attributes that give you responsive images for different screen densities.

    You should be using wp_get_attachment_image

    • This reply was modified 6 years, 6 months ago by ondoheer.

    Hi @ondoheer

    I’ve installed a3 lazy load plugin today. It seems to only work for images placed inside wysiwyg editor, but not in other ACFs (for example repeaters). Do you have any idea?

    Here is a link to page where you can see it (the page starts with big lazy loaded image, and then there is a table (repeater) which contains not lazy loaded logos.

    Thanks

    Hi @a3rev,

    Seems that the plugin doesn’t replace src with data-src which is causing the lazy loading to fail. If I set data-src instead of src it works.
    Any idea why this is happening>

    I load images like these via ACF and a3 is not working
    <img itemprop="image" class="pictures_image" width="<?php echo $pictures['width'] ?>" height="<?php echo $pictures['height'] ?>" src="<?php echo $pictures['url'] ?>" alt="<?php echo $rental_alt; ?>" />

    • This reply was modified 6 years, 3 months ago by matSatler.

    I’m using wp_get_attachment_image with ACF Gallery. But аttributes class=”lazy-loaded”, data-lazy-type=”image”, data-src=”” do not appear. In wysiwyg works.

    Maybe there is no compatibility with the new versions of ACF?

    • This reply was modified 6 years, 2 months ago by lidolov.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘ACF Support’ is closed to new replies.