Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Nguyen Tuan

    (@nguyencongtuan)

    Images from meta tag and it’s using custom code to get image so a3 Lazy Load plugin can’t filter for the image from that content.

    But so that it’s custom code, so you can add this to your code for can apply lazy load

    for example your code is
    $your_content = get_post_meta( $post_id, 'your_meta_key', true );

    then you can change it to like below for lazy load filter on your content

    $your_content = get_post_meta( $post_id, 'your_meta_key', true );
    $your_content = apply_filters( 'a3_lazy_load_html', $your_content, false );

    Hope that you can do that yourself

    Regards,
    Nguyen

    Please how to edit?

    // print the blog thumbnail
    function print_blog_thumbnail( $post_id, $item_size, $enable_comment = false ){
    if( empty($item_size) ){ return ”; }

    $thumbnail_types = get_post_meta( $post_id, ‘post-option-thumbnail-types’, true);
    if( $thumbnail_types == “Image” || empty($thumbnail_types) ){
    $thumbnail_id = get_post_thumbnail_id( $post_id );
    $thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );
    $alt_text = get_post_meta($thumbnail_id , ‘_wp_attachment_image_alt’, true);
    if( !empty($thumbnail) ){
    echo ‘<div class=”blog-media-wrapper gdl-image”>’;
    echo ‘<img src=”‘ . $thumbnail[0] .'” alt=”‘. $alt_text .'”/>‘;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lazy load Post meta images’ is closed to new replies.