Title: Replace Thumbnail Image with Custom Size
Last modified: August 30, 2016

---

# Replace Thumbnail Image with Custom Size

 *  Resolved [sueboothby](https://wordpress.org/support/users/sueboothby/)
 * (@sueboothby)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/replace-thumbnail-image-with-custom-size/)
 * I have a custom image size defined that I want to use in the related posts. Is
   this possible?
 * [https://wordpress.org/plugins/super-simple-related-posts/](https://wordpress.org/plugins/super-simple-related-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Mickey Kay](https://wordpress.org/support/users/mcguive7/)
 * (@mcguive7)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/replace-thumbnail-image-with-custom-size/#post-6630525)
 * Sure thing. . . the `ssrp_post_link` filter allows you to filter everything that
   goes inside the post link, which includes the image. So you should be able to
   use something like the following to filter in your own custom image size:
 *     ```
       add_filter( 'ssrp_post_link', 'prefix_ssrp_custom_post_link', 10, 2 );
       function prefix_ssrp_custom_image( $post_link, $post_id ) {
       	$post_link = '<a href="' . get_permalink( $post_id ) . '">' . get_the_title( $post_id ) . '</a>';
       	return '<a href="' . get_permalink( $post_id ) . '">' . get_the_post_thumbnail( $post_id, 'custom-size' ) . '</a>' . $post_link;
       }
       ```
   
 * Just throw that in a custom plugin, or in your theme’s functions.php file.
 *  [Joseph G.](https://wordpress.org/support/users/illumination2025/)
 * (@illumination2025)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/replace-thumbnail-image-with-custom-size/#post-8886260)
 *     ```
       add_filter( 'ssrp_post_link', 'prefix_ssrp_custom_post_link', 10, 2 );
       function prefix_ssrp_custom_post_link( $post_link, $post_id ) {
       	$post_link = '<a href="' . get_permalink( $post_id ) . '">' . get_the_title( $post_id ) . '</a>';
       	return '<a href="' . get_permalink( $post_id ) . '">' . get_the_post_thumbnail( $post_id, 'custom-size' ) . '</a>' . $post_link;
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replace Thumbnail Image with Custom Size’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/super-simple-related-posts_642b29.
   svg)
 * [Super Simple Related Posts](https://wordpress.org/plugins/super-simple-related-posts/)
 * [Support Threads](https://wordpress.org/support/plugin/super-simple-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/super-simple-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/super-simple-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/super-simple-related-posts/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Joseph G.](https://wordpress.org/support/users/illumination2025/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/replace-thumbnail-image-with-custom-size/#post-8886260)
 * Status: resolved