Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mickey Kay

    (@mcguive7)

    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.

    (@illumination2025)

    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.