• Resolved dukearmi

    (@dukearmi)


    Hi there,

    How can I make the query loop use medium or thumbnail sized featured images on mobile? I’m using a simple query loop on my homepage to show latest posts. Whenever I check PSI, it says that the loop is using full sized images.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Alvind

    (@alvindcaesar)

    Hi there,

    I believe WordPress handles this automatically by choosing the appropriate image sizes based on your settings in Settings > Media.

    Could you check your settings to see if you’ve specified the width and height for the thumbnail and medium sizes?

    Thread Starter dukearmi

    (@dukearmi)

    Hi Alvind,

    The thumbnail and medium sizes are set (150×0 and 300×0). Both are generated by WP (checked the upload folder).

    Plugin Support ying

    (@yingscarlett)

    Mobile phone screens with high resolution usually requires 2x its width to load the image.

    For example, if the phone screen is 350px, then it requires at least 700px width images.

    If you want mobile to load lower resolution images, you need to add a rewrite rule to load 150px width image on mobile, so it will actually use 300px images on mobile.

    
    function db_modify_srcset_sizes($sizes, $size) {
            $sizes = '(max-width: 440px) 150px, (min-width: 441px) 768px, (min-width: 769px) 1024px, 100vw';
    	return $sizes;
    }
    add_filter('wp_calculate_image_sizes', 'db_modify_srcset_sizes', 10 , 2)
    Thread Starter dukearmi

    (@dukearmi)

    I think I’ll let this one go for now. Thank you for the help though.

    Plugin Support ying

    (@yingscarlett)

    No Problem ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Query Loop Featured Image Size’ is closed to new replies.