• Resolved ashdav

    (@ashdav)


    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!

    Ash

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ashdav

    (@ashdav)

    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 ??

    Ash

    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?

    Thanks!

    Chris

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

    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.

    Thanks

    Sheryl
    Fashion Development Group

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding Images to RSS for use in Mailchimp RSS campaigns’ is closed to new replies.