Tagged: featured image, rss, width
-
AuthorPosts
-
July 5, 2015 at 9:58 pm #468609
Are there any settings within the theme or in functions.php that I can use to set a specific width for the featured images that show up in my RSS feed? I would like to put them at a smaller width than how they are being displayed in my posts (e.g., I want the rss image to be 564 in width). As of now, the RSS images are huge and they mess up my RSS to email templates in MailChimp. Please advise.
- This topic was modified 9 years, 4 months ago by ACNLatitudes.
July 6, 2015 at 8:29 pm #469228Hi ACNLatitudes!
You may need to upload them at a specific width. Send us a link and we’ll see if we can change it with CSS.
Best regards,
ElliottJuly 10, 2015 at 5:24 pm #471626OK. I included a link to the RSS feed in the private content area. Please note that I would like to keep the images on the actual Enfold WP site in large format, so I would prefer not to upload them at a smaller width. The only place where I want the smaller width images is within the RSS feed itself.
Please advise.
July 10, 2015 at 6:14 pm #471661Never mind. I was able to resolve the issue by using the following code in my functions.php file:
/*———————————————————————————–*/
/* Makes a Special Sized Image for MailChimp RSS Emails*/
/*———————————————————————————–*/
if ( function_exists( ‘add_image_size’ ) ) {
add_image_size( ‘mailchimp_featured’, 564, 9999); //564 pixels wide and unlimited height
}/*———————————————————————————–*/
/* Puts Featured Image into RSS Feed (Enfold Theme)*/
/*———————————————————————————–*/function avia_add_images_to_rss_feed($content)
{
global $post;
if ( has_post_thumbnail( $post->ID ) )
{
$content = get_the_post_thumbnail( $post->ID, ‘mailchimp_featured’, array( ‘style’ => ‘display: block;’ ) ) . ‘<br/>’ . $content;
}
return $content;
}add_filter(‘the_excerpt_rss’, ‘avia_add_images_to_rss_feed’);
add_filter(‘the_content_feed’, ‘avia_add_images_to_rss_feed’);July 13, 2015 at 11:22 am #472263 -
AuthorPosts
- The topic ‘Problem with Width of RSS Images’ is closed to new replies.