Support » Plugin: W3 Total Cache » Serving Different Image size for Mobile and Desktop Users

  • Hello, I have a responsive website and for mobile part I want medium size images to load instead full size to improve speed. I have used following code.

    <?php if ( has_post_thumbnail() ) {
    	if ( wp_is_mobile() ) { the_post_thumbnail('medium'); }
    	else
    	{ the_post_thumbnail(); }
    } ?>

    It seems to work fine, however often it caches medium size images for desktop side too. I am not sure how to make it work properly. I tried looking at the dynamic thing, but not sure how to do it. Any Idea?

    Thank you.

    https://wordpress.org/plugins/w3-total-cache/

  • The topic ‘Serving Different Image size for Mobile and Desktop Users’ is closed to new replies.