• Resolved GoffeyUK

    (@goffeyuk)


    Hey,

    Let me first say what a superb plugin this is. It’s so easy to setup, and get going. I love how we can control the output of it, which makes it really easy to style.

    I was wondering if there is anything in the works for lazy loading?. It would be great if it could work alongside an exisiting lazy load plugin such as Bj Lazy Load ?

    They have a apply filter option that looks something like:

    <?php
    $img_html = '<img src="myimage.jpg" alt="">';
    $img_html = apply_filters( 'bj_lazy_load_html', $img_html );
    echo $img_html;
    ?>

    I tried editing your plugin to apply this filter but with no success :'(

    https://wordpress.org/plugins/contextual-related-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    Hi Goffey,

    From what I read Bj Lazy Load only works with the content inside posts, which are likely the ones that are original to the post.

    You could try adding this to your functions.php of your theme. It’s not tested.

    function crp_lazy_load( $img_html ) {
    	return apply_filters( 'bj_lazy_load_html', $img_html );
    }
    add_filter( 'crp_get_the_post_thumbnail', 'crp_lazy_load' );
    Thread Starter GoffeyUK

    (@goffeyuk)

    Hi Ajay,

    Thanks for the quick response, that code works perfectly!

    Thank you very much!!

    Plugin Author Ajay

    (@ajay)

    You’re welcome. Thanks for reporting that it works.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Lazy Loading’ is closed to new replies.