[resolved] Adding Images to RSS for use in Mailchimp RSS campaigns (5 posts)

  1. ashdav
    Posted 2 years ago #

    Hi guys,

    I'm setting up an RSS mail campaign with Mailchimp, and I'm trying to have the feature image of posts displayed on emails via Mailchimp's *|RSSITEM:IMAGE|* tag.

    This article outlines how the tag is to be set up within RSS. I've tried a few plugins such as WP RSS Images but that doesn't appear to have done anything. I'm yet to find a solution, so I'm hoping someone here can help!

    How can I set up the feature image to be displayed in my blog's RSS feed so that I can call it out with Mailchimp? Is there a plugin available, or is there code I can add manually?

    For reference, my blog is PhotoGuides.net

    Thanks in advance!


  2. ashdav
    Posted 2 years ago #

    Ok I've found a solution.

    In your themes functions.php file, add this code

    function featuredtoRSS($content) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'float:left; margin:10px 15px px 0;' ) ) . '' . $content;
    return $content;
    add_filter('the_excerpt_rss', 'featuredtoRSS');
    add_filter('the_content_feed', 'featuredtoRSS');

    This will then call up the featured image of your post and embed it in your RSS feed. You can change the margins and styles within that code too.

    Crucially, I found it took a few hours to wade through to my feed. I'm using Feedburner on Mailchimp and, because it didn't work instantly, I figured it didn't work. Give it time.

    This code won't allow the use of *|RSSITEM:IMAGE|* but if you embed the post in Mailchimp via *|RSSITEM:CONTENT|* then it will add a full-sized featured image followed by your post's excerpt.

    Hopefully this solution works for other people! Remember to give it some time to update :)


  3. thewritesignal
    Posted 2 years ago #

    Thanks so much for this, Ash.

    I'm having some trouble with formatting how the images appear in the feed. Are you wrapping the MailChimp shortcodes in a div or do you have a different way of doing it?



  4. thewritesignal
    Posted 2 years ago #

    SORRY - I just discovered the area in the actual functions.php code for styling. Thanks again!

  5. Sheryl
    Posted 2 years ago #

    Help with RSS to e-mail set up in MAILCHIMP.

    I am setting up an RSS driven campaign now. I chose the RSS Basic template and uploaded my custom banner to the top. I sent out a TEST e-mail and I see it is all text. Is there a way to have the first top photo of my blog post insert into the e-mail automatically? Without a photo it looks like a business letter. I run a fashion business and it needs to look fashionable.


    Fashion Development Group

Topic Closed

This topic has been closed to new replies.

About this Topic