-
AuthorPosts
-
April 21, 2017 at 4:24 pm #781296
Hi,
I opened a thread about this and I thought it was solved so that thread is now closed, but it appears I need to still increase the size of the photos in my RSS feed at http://www.thomashenthorne.com/feedI’m not a coder so before modifying functions.php, I wanted to ask for your input. The current code you gave me is:
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = ‘<div>’ . get_the_post_thumbnail( $post->ID, array( ‘width’=>150, ‘height’=> 150 ), array( ‘style’ => ‘margin-bottom: 15px;’ ) ) . ‘</div>’ . $content;
}
return $content;
}
add_filter(‘the_excerpt_rss’, ‘featuredtoRSS’);
add_filter(‘the_content_feed’, ‘featuredtoRSS’);It looks to me like it’s feeding a 150 x 150 image to RSS which is too small. I would rather send the Enfold medium size which is 300×300, and then understand how to send a large size if that is still too small for the feed.
Can you help me customize above code?
Thanks!!!
RobApril 22, 2017 at 10:11 am #781633Hey Rob,
To attach the 300×300 size image to it, we’ll just change the values in the fourth line so that it becomes this:
function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, array( ‘width’=>300, ‘height’=> 300 ), array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS');Can you try that out please?
Sarah
April 22, 2017 at 10:12 pm #781794Thanks for your help!
I inserted the above code and it still appears when visiting http://www.thomashenthorne.com/feed that the photos are 150×150? See below copy paste from the rss feed page:
<description><