View Single Post
Old 03-21-2021, 02:49 PM  
kingtom2020
Confirmed User
 
Industry Role:
Join Date: Sep 2020
Location: UK
Posts: 56
Quote:
Originally Posted by Colmike9 View Post
Use this in functions:

Code:
function disable_post_content_iframe_lazy_loading( $default, $tag_name, $context ) {
    if ( 'iframe' === $tag_name && 'the_content' === $context ) {
        return false;
    }
    return $default;
}
add_filter(
    'wp_lazy_loading_enabled',
    'disable_post_content_iframe_lazy_loading',
    10,
    3
);
Or use a plugin: https://wordpress.org/plugins/disabl...g-for-iframes/


I think WP only makes an iframe loading=lazy only if the height and width is defined, too.
Hi

where in my wordpress do I add this code ?
kingtom2020 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote