WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking to create an alternate RSS feed for a specific group of tags with custom image sizes to be used with MailChimp.

Is it possible to customize RSS feeds for specific tags? For example the tag "Apple" we would like the feed to have an image size of 100x100 in the RSS feed, whereas for the tag "Orange" we would like the images to be of size 500x500? We're using this for a MailChimp RSS newsletter and MailChimp can only pickup the first image within the feed so we need the sizing to be done on a per-tag basis and on the feed-level rather within the HTML/CSS.

share|improve this question

Filter 'the_content_feed' or 'the_excerpt_rss' and use a thumbnail image of your choice.

Sample code, not tested:

add_filter( 'the_content_feed', 'wpse_70249_custom_thumb' );
add_filter( 'the_excerpt_rss', 'wpse_70249_custom_thumb' );

function wpse_70249_custom_thumb( $content )
    global $post;

    $thumb_size = 'post-thumbnail';

    if ( in_category( 'orange', $post )
        $thumb_size = array ( 500, 500 );
    if ( in_category( 'apple', $post )
        $thumb_size = array ( 100, 100 );

    $thumb = get_the_post_thumbnail( null, $thumb_size );

    return $thumb . $content;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.