Skip to content

Commit c234b57

Browse files
author
Marcel Moll
committed
Create add_post_images_to_rss_feed.php
1 parent fc0f0da commit c234b57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

add_post_images_to_rss_feed.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function add_post_image_to_rss($content) {
2+
global $post;
3+
if ( has_post_thumbnail( $post->ID ) ){
4+
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
5+
}
6+
return $content;
7+
}
8+
9+
add_filter('the_excerpt_rss', 'add_post_images_to_rss');
10+
add_filter('the_content_feed', 'add_post_images_to_rss');

0 commit comments

Comments
 (0)