Support » Plugin: Related Posts for WordPress » Thumbnail posts same size?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    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.

    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

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @dviolante,

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

    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)
  • You must be logged in to reply to this topic.