I'm using the following code to add a featured image to my rss feed in wordpress.
add_action( 'rss2_item', 'add_post_featured_image_as_rss_item_enclosure' );
function add_post_featured_image_as_rss_item_enclosure() {
if ( ! has_post_thumbnail() )
return;
$thumbnail_size = apply_filters( 'rss_enclosure_image_size', 'thumbnail' );
$thumbnail_id = get_post_thumbnail_id( get_the_ID() );
$thumbnail = image_get_intermediate_size( $thumbnail_id, $thumbnail_size );
if ( empty( $thumbnail ) )
return;
$upload_dir = wp_upload_dir();
printf(
'<enclosure url="%s" length="%s" type="%s" />',
$thumbnail['url'],
filesize( path_join( $upload_dir['basedir'], $thumbnail['path'] ) ),
get_post_mime_type( $thumbnail_id )
);
}
But the plguin above is outputting a really small image 150x150. I tried changing the thumbnail size to full or large, but it won't work. Is there any way to add a url to the full featured image size in the enclosure field below?
Thanks in advance