Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Support request] WPSP & Imagify

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support WPSP & Imagify

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15385
    David
    Participant

    Hi,

    I recently noticed that not all images on my site are showing with the <picture> tag around them.
    The images from my theme GP Premium work fine, but the images from WPSP do not have the <picture> tag around them.
    I use WP Rocket and Imagify. The Imagify option to display the <picture> is used.

    I made a short 4 minute video explains this.

    Thank you for your time.

    #15392
    Tom
    Keymaster

    Hi there,

    This is likely due to how WPSP resizes images.

    Instead of using the built-in image resizing options, I would do this: https://wpshowposts.com/support/topic/show-posts-images-not-working/#post-8324

    #15398
    David
    Participant

    Hi Tom,

    We definitely made progress on this.

    This filter works great for 5 of the 8 WPSP grids I’m using. By this I mean, if I do not specify an image size in WPSP, then the image is served with the <picture> tag as expected.

    However, I still have 3 WPSP grids do not use the default image size.

    This filter only sets the default size, and so anytime I set the size in WPSP it does not use the <picture> tag.

    #15416
    Tom
    Keymaster

    What do you mean by “set the size in WPSP”? Are you using the width/height controls for those lists?

    #15424
    David
    Participant

    Hi Tom,

    I don’t understand you question.
    But it’s okay I made a very short video explaining the issue I’m having.

    Thank you very much, David

    #15498
    Tom
    Keymaster

    Hi David,

    That makes sense, as our resizer kicks into gear when you specify custom image sizes in the list. That image resizer typically won’t work with plugins like filter the output of normal featured images, which are output when no custom sizes are added.

    This is a tricky issue as of right now, as there’s no way to target individual lists with that filter.

    However, you can see in the next version we’ve added a $settings variable to the filter: https://github.com/tomusborne/wp-show-posts/blob/release/1.2/inc/functions.php#L193

    So if you make that change to your current version, you’d be able to do this:

    add_filter( 'wpsp_default_image_size', function( $size, $settings ) {
        if ( 123 === $settings['list_id'] ) {
            return 'size-for-123-list';
        }
    
        if ( 456 === $settings['list_id'] ) {
            return 'size-for-456-list';
        }
    
        return 'medium'; // Size for everything else.
    }, 10, 2 );

    Let me know if you need more info 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.