Hi I use the following function to add a thumbnail to the post in the rss feed.
<?php
function insertThumbnailRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'insertThumbnailRSS');
add_filter('the_content_feed', 'insertThumbnailRSS');
?>
But instead of only using the post_thumbnail that I have to set mannualy I would like the function to fallback to the first uploaded image of the post's gallery (thumbnail size).
How can I do this ?
Many thanks for your time and help.