Support » Plugin: Super Simple Related Posts » Featured Image Size

  • Hi, I’d like to be able to set the featured image size so that extremely large images aren’t loaded into the page’s sidebar.

    I tried doing it with this code:

    function gc_ssrp_thumbnail_modifications( $post_title, $post_id ) {
        return get_the_post_thumbnail( $post_id, 'medium' ) . $post_title;
    }
    add_filter( 'ssrp_post_title', 'gc_ssrp_thumbnail_modifications' );

    But got an error saying that I was missing argument 2 ($post_id). Any ideas why $post_id would not be accessible from this filter?

    Regardless, if there was an option to select the image size used for the Featured Image, then I wouldn’t need to access the code. Thanks, this is a great little plugin.

    https://wordpress.org/plugins/super-simple-related-posts/

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

    (@mcguive7)

    Looks like you just need to add a few parameters to the filter call to indicate the number of args being passed, like so:

    add_filter( 'ssrp_post_title', 'gc_ssrp_thumbnail_modifications', 10, 2 );

Viewing 1 replies (of 1 total)
  • The topic ‘Featured Image Size’ is closed to new replies.