display advanced custom field image in rss feed

I’m trying to customize my rss feed by displaying an image using a advanced custom field.
using my custom code I get the image src but I would like to display the image.
the advanced custom field is named “image_rss” and returns the image src.

here is my code (inside function.php) I also get the thumbnail from each post.

Read More
automatic_feed_links();

function wpc_rss_miniature($excerpt) {
global $post;
$custom_image_rss = the_field('image_rss');
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . 
'</p>' . get_the_excerpt(); '<img src="'. $custom_image_rss .'">';

return $content;
}
add_filter('the_excerpt_rss', 'wpc_rss_miniature');
add_filter('the_content_feed', 'wpc_rss_miniature'); 

can anybody help me with this ?
I can’t find how to display the image, and not only get the src of the image
thanks for your help

Related posts

Leave a Reply