Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Squazz

    (@squazz)

    Ok, I wrote that it worked for featured images. I don’t really think that it does that actually.

    I have created these image sizes:

    add_image_size( 'pf-smallest', 260, 9999);
    add_image_size( 'pf-small', 400, 9999);
    add_image_size( 'pf-medium', 580, 9999);
    add_image_size( 'pf-large', 600, 9999);
    add_image_size( 'pf-largest', 755, 9999);
    
    add_image_size( 'mobile-thumb-large', 440, 207, true );
    add_image_size( 'mobile-thumb-small', 80, 80, true );

    But the HTML I get is the following:

    <img width=”700″ height=”329″ src=”https://squazz-df5.kxcdn.com/wp-content/uploads/2014/12/IMG_1773-700×329.jpg&#8221; srcset=”https://squazz-df5.kxcdn.com/wp-content/uploads/2014/12/IMG_1773-440×207.jpg 440w, https://squazz.dk/wp-content/uploads/2014/12/IMG_1773-700×329.jpg 700w” class=”attachment-thumb-large wp-post-image” alt=”3 m?neders Israelsk visum”>

    The 700w image size is from the theme, the 440w I try to convince myself is my own creation. But then I don’t get why the RICG plugins does not fetch my other images and offers these?

    Plugin Contributor Joe McGill

    (@joemcgill)

    Hi Squazz,

    It looks like your theme is using a custom crop that is 700px x 329px for featured images which is a different aspect ratio than the original images that you are uploading. The plugin looks through all of the image crops available and only adds the images which have the same aspect ratio to the srcset list. In this case, the only one that matches is the 440px x 207px crop.

    Regarding the backward compatibility for content images, the plugin will add a srcset attribute on new images that you embed in posts, but it won’t affect images from posts that you’ve already published.

    I hope this helps.
    Joe

    Thread Starter Squazz

    (@squazz)

    Regarding the custom crop, then that is rather smart, love it! ??

    Is there any reason why it won’t affect old embeds? And is there a way to make it do that?

    Thread Starter Squazz

    (@squazz)

    Another thing.
    At my website I’m using a CDN, setup with W3 Total Cache. Is there any way to make the plugin use the images on my CDN in stead of the ones at my webhost?

    At the moment the plugin generates the following fo my features image:

    <img width="700" height="329"
    src="https://squazz-df5.kxcdn.com/wp-content/uploads/2014/12/IMG_1773-700x329.jpg"
    srcset="https://squazz-df5.kxcdn.com/wp-content/uploads/2014/12/IMG_1773-440x207.jpg 440w,
    https://squazz.dk/wp-content/uploads/2014/12/IMG_1773-700x329.jpg 700w"
    class="attachment-thumb-large wp-post-image"
    alt="3 m?neders Israelsk visum" style="display: block;">

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Works for featured images, but not post-images’ is closed to new replies.