Jump to content
Sign in to follow this  
bonngean

Double Post Thumbnails in RSS Feed

Recommended Posts

bonngean

Hi, I wanted to add the post thumbnail to my rss feed and followed the instructions from this post: http://www.pagelines.com/forum/topic/8437 The problem I have now is that the RSS Feed is showing the entire post in my RSS Feed when I only want the excerpt to show -- and it's adding all the pictures associated with the content. I don't want this to happen! I merely want the rss feed to show the thumbnail associated with the blog excerpt and not the entire contents of the post/pictures. What do I need to fix this problem? http://herodawn.com/feed/ Here's the code I added to functions.php:

//------ Enable Post Thumbnails ------//
	add_theme_support('post-thumbnails');
	
	//------ Add Thumbnails To RSS Feed ------//
	
	function rss_post_thumbnail($content) {
	global $post;
	if(has_post_thumbnail($post->ID)) {
	$content = '<p>' . get_the_post_thumbnail($post->ID) .
	'</p>' . get_the_content();
	}
	return $content;
	}
	add_filter('the_excerpt_rss', 'rss_post_thumbnail');
	add_filter('the_content_feed', 'rss_post_thumbnail');

--Bonnie

Share this post


Link to post
Share on other sites
ricardo

Hi Bonnie! The excerpt problem can be solved by replacing get_the_content() with get_the_excerpt() Regarding the images, are you using a featured image in your posts? Ricardo

Share this post


Link to post
Share on other sites
bonngean

@Ricardo, Yes, I am using a featured image in my posts as those then are added to my carousel. And then, the graphic is being used inside the post as well. So then... how do I get only get the featured image to show up in the RSS feed and none of the other images used inside the post? Thanks for your help. --Bonnie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×