Skip to content

Instantly share code, notes, and snippets.

@nathanaelphilip
Created April 16, 2014 15:17
Show Gist options
  • Save nathanaelphilip/10892539 to your computer and use it in GitHub Desktop.
Save nathanaelphilip/10892539 to your computer and use it in GitHub Desktop.
add_filter( 'rss2_item', 'mailchimp_attached_images' );
function mailchimp_attached_images() {
global $post;
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' );
if ( $thumbnail ) {
?>
<media:content url="<?php echo $thumbnail[0]; ?>" type="image/jpeg" medium="image" width="100%"></media:content>
<?php
}
}
add_filter( 'rss2_ns', 'flipboard_namespace' );
function flipboard_namespace() {
echo 'xmlns:media="http://search.yahoo.com/mrss/"
xmlns:georss="http://www.georss.org/georss"';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment