Quantcast
Channel: How to modify the image size in RSS (mailchimp compatibility)? - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to modify the image size in RSS (mailchimp compatibility)?

$
0
0

I am using the following code in my functions.php and it shows the thumbnail properly in my mailchimp's campaign test email ...

function dn_add_rss_image() {
global $post;

$output = '';
if ( has_post_thumbnail( $post->ID ) ) {
    $thumbnail_ID = get_post_thumbnail_id( $post->ID );
    $thumbnail = wp_get_attachment_image_src( $thumbnail_ID, 'thumbnail' );

    $output .= '<media:content xmlns:media="http://search.yahoo.com/mrss/" medium="image" type="image/jpeg"';
    $output .= ' url="'. $thumbnail[0] .'"';
    $output .= ' width="'. $thumbnail[1] .'"';
    $output .= ' height="'. $thumbnail[2] .'"';
    $output .= ' />';
  }
  echo $output;
}
add_action( 'rss2_item', 'dn_add_rss_image' );

but I'd like to show large size images in my campaign since the thumbnail looks bad and the image is cut. Please help me modify the code above to show full featured images with the ability to change the width.

Any help is highly appreciated.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images