LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Tips » Add Featured Image In RSS Feed Of WordPress Without Plugin

Add Featured Image In RSS Feed Of WordPress Without Plugin

Add-Featured-Image-In-RSS-Feed-Of-WordPress-Without-Plugin
Photographs are playing a larger part involving blogging, with subjects that high light the posts’ showcased images more popular, creating fantastic visually appealing layouts. More so while using the popularity involving Pinterest along with Facebook discussing, which uses an image from the actual page as well as post.

Despite the presence of various options for including distinct Facebook OpenGraph code inside your post, your content could be shared by means of other methods that don’t consider the Opengraph information under consideration, like RSS OR ATOM and feed syndication as well as sharing services much like the awesome DLVR. the idea or Feedburner.

Right now, you can exhibit featured images in Rss of your WordPress web site. This will make your Rss more interesting by displaying the featured images inside rather than featuring just text within your blog RSS nourish.

How To Add Featured Image In RSS Feed Of WordPress Without Plugin

Step 1:) Copy the below code and Paste in your Theme Function(function.php) file.

/* ------------------------------------------------------------------------- *
* Add Featured Image In RSS Feed Of WordPress
/* ------------------------------------------------------------------------- */
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');

Customization:

To display larger images instead, change the word ‘thumbnail‘ to ‘medium‘, ‘large‘ or ‘full‘. To add/remove the style from that images, edit the bold style in the upper code that is float:left; margin:0 15px 15px 0;.

Theme Files Editing Warning:

Keep in mind that every code that you will add in your themes files will be removed when you will change the theme. So after changing your theme, you have to follow this article again and you will get everything back same as it is now.

Last Words:

This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.

You Like It, Please Share This Recipe With Your Friends Using...

2 Responses to “Add Featured Image In RSS Feed Of WordPress Without Plugin”

  1. Syed says:

    Thanks for sharing resourceful short article. Once once more thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *