Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @dviolante,

    Thanks for reaching out to us.

    You will need a filter to change this. First, you will need to define a custom thumbnail size and then you can use the filter function provided at https://www.relatedpostsforwp.com/documentation/changing-the-thumbnail-size/ to use your custom thumbnail size for images displayed by our plugin.

    Thread Starter dviolante

    (@dviolante)

    Hello Harish, thanks a lot for your response.
    Could you please tell me if this code is correct?

    add_image_size( ‘my-thumbnail-size’, 150, 84 );

    function rp4wp_example_my_thumbnail_size( $thumb_size ) {
    return ‘my-thumbnail-size’;
    }

    add_filter( ‘rp4wp_thumbnail_size’, ‘rp4wp_example_my_thumbnail_size’ );

    Thanks

    Hey @dviolante,

    Yes, that is correct. Please make sure to use a plugin such as https://www.ads-software.com/plugins/regenerate-thumbnails/ to regenerate all the thumbnails.

    Thread Starter dviolante

    (@dviolante)

    Hello, yes, im using that plugin! Thanks.

    I was missing something in the function code: true before height. With this now my thumbs are regenerated a the exact 150 x 84 size.

    add_image_size( ‘my-thumbnail-size’, 150, 84, true );

    function rp4wp_example_my_thumbnail_size( $thumb_size ) {
    return ‘my-thumbnail-size’;
    }

    add_filter( ‘rp4wp_thumbnail_size’, ‘rp4wp_example_my_thumbnail_size’ );

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Thumbnail posts same size?’ is closed to new replies.