-
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><![CDATA[<div></div>
<p>My clients and friends Jim Tyson and Mike Perona have been renovating homes since they moved to Marin County from San Francisco’s Noe Valley neighborhood back in 2002. They transformed their first home, 22 Spring Grove in San Rafael’s West End neighborhood, into a showplace, but craved a larger home with views. When they first walked through the doors of 42 Edgewood Way in San Rafael’s Fairhills neighborhood, they immediately saw the potential.</p>
<p>The post Client Profile: Jim and Mike’s Remodel in San Rafael’s Fairhills Neighborhood appeared first on <a rel=”nofollow” href=”http://www.thomashenthoThe reason this is important is Mailchimp uses this photo in “new blog article” campaigns it mails out, and it is sending out a very small picture which it then tries to enlarge and looks fuzzy.
Thanks!
April 22, 2017 at 10:23 pm #781798It seems like we need to change the “thumbnail” to another photo size in the code per this advice in this thread:
https://kriesi.at/support/topic/large-image-in-rss-feed/
?
April 27, 2017 at 7:21 am #783822Hi,
Please replace the filter with the following. We are going to use the “portfolio” thumbnail which has a maximum dimension of 450x450px.
function avf_featured_image_rss($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'portfolio' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'avf_featured_image_rss'); add_filter('the_content_feed', 'avf_featured_image_rss');
Best regards,
IsmaelAugust 9, 2017 at 5:03 pm #836498I had overcome the issue with this by just going into settings –> media and changing the default thumbnail size when uploading from 80×80 to a much larger size. This worked fine until recently when an update reverted the thumbnail back to 80×80, so the last two posts on my feed show very small photos and those are being passed to Mailchimp. Mailchimp needs larger photos or else the emails it sends out have blurry photos.
http://www.thomashenthorne.com/feed/
When I changed the functions.php to the above code on my staging site, the thumbnails are still small (cache cleared) when I view them with https://codebeautify.org/rssviewer
Is there another solution to get Enfold to pass larger (450×450) size photos to the rss feed?
Thanks much
RobAugust 10, 2017 at 1:43 pm #836971Hi Rob,
You need to set the thumbs to a bigger size again and regenerate thumbnails.
Best regards,
VictoriaAugust 10, 2017 at 7:50 pm #837133Great, thanks, should I remove the code from the functions.php file then?
This worked and I used a re-generate plugins plug just to regenerate the two photos that had been uploaded since the thumbnail setting size changed. In case anyone else is searching threads and has the same issue, the optimal size for thumbnails for Mailchimp campaigns is 600×600 and allow thumbnails to remain proportional under the settings –> media menu.
Thanks,
RobAugust 11, 2017 at 1:43 pm #837452Hi Rob,
Whichever works for you! Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Need to change photo size in RSS Feed’ is closed to new replies.