Code für functions.php
Füge einfach folgenden Code ans Ende deiner functions.php
-Datei hinzu.
// Fügt Posts im RSS-Feed das Beitragsbild hinzu
function wpc_rss_featured_image($content)
{
global $post;
// Überprüfen, ob Artikel ein Beitragsbild hat
if (has_post_thumbnail($post->ID))
{
$content = get_the_post_thumbnail($post->ID, 'full', array('style' => 'margin-bottom:10px;')) . $content;
}
return $content;
}
// Filter für RSS-Auszug
add_filter('the_excerpt_rss', 'wpc_rss_featured_image');
// Filter für RSS-Content
add_filter('the_content_feed', 'wpc_rss_featured_image');
Den Abstand des Bildes nach unten zum Inhalt kannst du in Zeile 8 anpassen. Ändere dazu einfach margin-bottom:10px;
in deinen gewünschten Abstand.
Beachte auch, dass nur das Beitragsbild hinzugefügt wird und nicht das erste Bild des Inhalts. Wenn kein Beitragsbild hinterlegt ist, wird auch keins im RSS-Feed angezeigt.