Adding Post Images in WordPress Feed
-
I am trying to add Images to the RSS feeds for each article. Every article from blog post may or may not have an image. If it has an Image i want to pick the first image and add it to my RSS feed. Else a default image in the RSS feed item for that post.
I have tried following codes:
/* Function to add images in the RSS Feed Start: Date Added 4-15-2013*/ function my_feed_thumbnail($content) { if (is_feed() && has_post_thumbnail()) { return get_the_post_thumbnail( get_the_ID(), 'medium' ) . $content; } return $content; } add_filter('the_content', 'my_feed_thumbnail'); /* function featuredtoRSS($content) { global $post; if (has_post_thumbnail( $post->ID )) { $content = '' . get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS'); */ /* Function to add images in the RSS Feed End*/Still none of these worked. My feeds at http://feeds.feedburner.com/windowsvj does not have an image yet.
And yes i successfully pinged my server several times as well.
Links i referred to :
http://brandswithfansblog.fandommarketing.com/how-to-optimize-rss-to-display-featured-blog-images/
http://www.staenzwebsolutions.com/how-to-add-post-thumbnail-or-a-thumbnail-image-to-wordpress-rss-feeds/442/Have found about the plugins at :
http://wordpress.org/extend/plugins/wp-rss-images/
http://wordpress.org/extend/plugins/get-the-image/
http://justintadlock.com/archives/2008/01/27/custom-fields-for-feeds-wordpress-plugin
http://web-argument.com/2008/11/09/wp-rss-images-wordpress-plugin/but not sure if anyone has a luck with these…
The topic ‘Adding Post Images in WordPress Feed’ is closed to new replies.