• I have a WordPress site , Although srcset (150 *150) is available, it shows large size in mobile

    Although the css command is 150*150, it loads 250 *250
    That is,images 250 *250 is loaded in the 150 *150 position

     $imageAttr = array(
                    "class"=>"alignnone size-medium",
                    "alt"=>get_the_title($post->ID),
            );
    
            $imageTag = get_the_post_thumbnail( $post->ID, "medium", $imageAttr);
    
            $imageTag = "<p style='text-align: center'>$imageTag
    ";

    You can check this link to see this problem
    sanjamusics.ir/ehsan-daryadel-chi-mishe-rad-beshi-az-kochamon-mp3/

    • This topic was modified 4 years, 3 months ago by sanjamuy.
    • This topic was modified 4 years, 3 months ago by sanjamuy.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s up to the browser to fetch the 150px version if it wants to. WP simply provides the needed information in srcset and sizes attributes. It does not dictate what the browser must do. What can happen with mobiles is their actual display resolution is higher than the nominal pixel size used to layout the page, so even though the size is 150px nominal, the phone might be capable of displaying a 300px image in that space for a sharper image (e.g. “retina” displays) Since 250px is as close to 300 as it can get, that’s what is fetched. Other devices with poorer resolution may choose to fetch the 150px version.

Viewing 1 replies (of 1 total)
  • The topic ‘images 250 *250 is loaded in the 150 *150 position’ is closed to new replies.