0

Good morning,

I'm trying to modify a plugin, to lazy load my images (a3 lazy load).

The problem is that this plugin is returning only the images in the content, but for some reason when we created our website, we put all of our images outside WordPress. I don't even think that it is the problem because recently I discovered that that very plugin like I stated before, parse only the images in the content, so all our "static" images outside the loop won't be targeted. I can do in two ways:

  1. I can create a footer as a page, but I don't love this idea.

  2. I can create several widgets to store my images in the footer and in the header.

3, I can modify the plugin.

Right now I'm trying the approach n.3: I need to know how to modify this line in order to change this filter and returing ALL THE IMAGES, instead of just the one in the LOOP:

if ( $a3_lazy_load_global_settings['a3l_apply_image_to_content'] == true ) {
                add_filter( 'the_content', array( $this, 'filter_content_images' ), 100 );

                // Compatibility with ACF plugin - Thank you ondoheer https://github.com/ondoheer
                add_filter( 'acf_the_content', array( $this, 'filter_content_images' ), 100 );

            }

Is there any different filter that will allow targeting the entire document?

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.