Ready to get started?Download WordPress


Jetpack by WordPress.com
[resolved] Photon resizing images incorrectly in IE8 (3 posts)

  1. lindseybugbee
    Posted 1 year ago #


    I activated Jetpack's Photon, v2.2, and I'm having issues with how images are displayed in IE8. When Photon is activated, images are displayed with a width and height value of 1px, so basically they can't be seen. My code in my custom theme for getting the featured images is:

    function get_featured_image($post_id, $size, $class, $title)
    if($class == NULL) { $class = 'wp-featured-image'; } else { $class = $class . ' wp-featured-image'; }
    if($post_id == NULL) { $post_id = get_post_thumbnail_id(); }
    $wp_featured_image = wp_get_attachment_image_src($post_id, $size, true);

    $src = $wp_featured_image[0];
    $width = $wp_featured_image[1];
    $height = $wp_featured_image[2];

    $output = '<img width="'.$width.'" height="'.$height.'" src="'.$src.'" class="'.$class.'" alt="'.$title.'" title="'.$title.'" />';

    return $output;

    Any ideas or suggestion on how to fix this issue are welcome!


  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    As mentioned in this thread, the lack of width and height in the data returned by wp_get_attachment_image_src() is a necessary side-effect of using Photon.

    You can overwrite the default Photon settings by following the instructions here:

  3. lindseybugbee
    Posted 1 year ago #

    A solution in my case was to simply remove the width and height attributes from the img tag.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic