LATEST >>

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

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Snippets » Add Some Content In The RSS Feed Of WordPress Without Plugin

Add Some Content In The RSS Feed Of WordPress Without Plugin

Add-Some-Content-In-The-RSS-Feed-Of-WordPress-Without-Plugin
WordPress RSS Feed are also useful to get traffic from your royal visitors so it is important to have your RSS feed. Now you know that RSS feed pick the default data from your post to show it all there where others are reading your RSS feed but if you want to target your RSS feed users with some news, data then you dont have to edit your posts.

So there are many plugins available to do this work but if there is a way to do it without plugin then that is too good and leave the plugin. Now here we are sharing the code below that will do the same work without editing anything and will add your desired data before and after RSS content of every post of your blog and will be showed on every place.

Now without any more preface, here its time to directly go to the tutorial to get the steps. Then you have to follow that s steps using the below shared code that will do what we said above. After this just do the customization that you want and thats it it. So move on to do it.

Table of Contents

How To Add Some Content In The RSS Feed Of WordPress Without Plugin?

Step 1:) Open Appearance > Editor file in your WordPress dashboard.
Step 2:) Open your Theme Function (function.php) file from the list of your theme file.
Step 3:) Copy the below code and Paste it in the end of function.php file.

/* ------------------------------------------------------------------------- *
 * Add Some Extra Data, Text, Encoded HTML In The End Of RSS
/* ------------------------------------------------------------------------- */
function exeideas_postrss($content) {
if(is_feed()){
$content = 'Before RSS Feed Content'.$content.'After RSS Feed Content.';
}
return $content;
}
add_filter('the_excerpt_rss', 'exeideas_postrss');
add_filter('the_content', 'exeideas_postrss');

Step 4:) Update file and done.
Step 5:) Now you will see your extra data in your Feed and all there where your feed is using.

Customization:

You just have to change Before RSS Feed Content and After RSS Feed Content text with your data, text or Encoded HTML. Rest nothing to change. If you dont want any section then leave that blank.

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.

Recommended For You:
How To Optimize External CSS File For Better Loading?

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

Be the first to write a comment.

Leave a Reply

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