Tagged: rss feed
-
AuthorPosts
-
March 28, 2017 at 1:44 am #767824
A while ago, support (sorry, can’t remember who) helped me add the featured photo for my blog posts to the RSS feed using the following addition to functions.php in my child theme:
/**** Add blog photos to RSS Feed ****/
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = ‘<div>’ . get_the_post_thumbnail( $post->ID, ‘medium’, array( ‘style’ => ‘margin-bottom: 15px;’ ) ) . ‘</div>’ . $content;
}
return $content;
}
add_filter(‘the_excerpt_rss’, ‘featuredtoRSS’);
add_filter(‘the_content_feed’, ‘featuredtoRSS’);This worked great for a long time and Mailchimp sent out notifications of new blog articles to my subscribers and included a nice looking photo. However after recent updates, my featured photo now looks blurry like it’s being upsized from a thumbnail to a larger photo causing pixelation.
Here’s the feed for a recent photo if that provides a hint:<description><![CDATA[<div></div>
Can you help me fix this? My theory is that the code in functions.php is sending the thumbnail which is only 80 x 80 pixels to the RSS feed which is then trying to up size it causing loss of resolution.
Thanks!
RobMarch 28, 2017 at 4:49 pm #768285Hey goldengate415,
Could be that some thumb settings changed. You could try to use big thumb
get_the_post_thumbnail( $post->ID, ‘large’, array( ‘style’ => ‘margin-bottom: 15px;’ ) )
and see what happens.
If you need further assistance please let us know.
Best regards,
VictoriaMarch 28, 2017 at 4:53 pm #768293Hi Victoria!
Welcome to Enfold! I think you are new here? Thank you for your help!!!
I went into WordPress settings and changed the default thumbnail from 80×80 to 150×150 and am hoping this might solve it? Do you think I also need to make the modification above?
Thanks!!!!
Rob
March 29, 2017 at 9:18 am #768683Hi Rob,
Yes, I am new, thank you :) There’s only one way to find out. You have to test it, with these changed thumbs and no code modification, and then if that does not work, try the code modification.
If you need further assistance please let us know.
Best regards,
VictoriaMarch 29, 2017 at 4:57 pm #768919Ha ha ok Victoria, well welcome, we are glad you’re here… they desperately need help with the volume of requests they receive.
I will try this and report back on this thread if this works, so please leave thread open. Thanks! Rob
March 31, 2017 at 6:39 pm #770126Changing settings to 150×150 for Thumbnail photo solved the issue… thanks!
March 31, 2017 at 7:47 pm #770143Hey!
We are happy we can help!
If – for any reason you need to use the Thumbnail option for somewhere else to the template
you can use the followingget_the_post_thumbnail( $post->ID, array( 'width'=>150, 'height'=> 150 ), array( 'style' => 'margin-bottom: 15px;' ) )
Let us know if we can do anything else for you!
Cheers!
Basilis -
AuthorPosts
- The topic ‘Featured Photo in RSS Feed’ is closed to new replies.