LATEST >>

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

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Tricks » For Newbies: How To Add Any Data After Posts In WordPress?

For Newbies: How To Add Any Data After Posts In WordPress?

How-To-Add-Any-Data-After-Posts-In-WordPress
WordPress is an open CMS and easy to edit or code but if you are new to it then it is very hard to edit it. Now here we are trying to make it simple to you by sharing simple tutorial too in our previous posts that you can see there. NOw its time to make a simple tutorial if you want to add any data after your WordPress posts.

So let consider that you want to ad adsense code, social sharing button, banner ads, affiliate links, any text or anything else just after your full posts not pages or any other blog page so for this you have to edit theme but there if you make a little mistake then your whole blog can be mess up so if is better not to touch that. But you can still do it by using out simple code tutorial. Just use the below code and add anything whatever you want.

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.

Recommended For You:
How To Upload A Plugin To WordPress Plugin Directory?

Table of Contents

Features:

1.) Pure PHP code.
2.) Just have to edit function.php file.
3.) No extra editing required.
4.) Can add Text/HTML too.
5.) Conditional tag added.

How To Add Any Data After Posts In WordPress?

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

/* ------------------------------------------------------------------------- *
 * Add Any Data After Posts In WordPress
/* ------------------------------------------------------------------------- */
function exe_add_data($content){
 if(!is_feed() && !is_home()) {
 $content .= '+++ENCODED HTML CODE HERE+++';
 }
 return $content;
}
add_action('the_content', 'exe_add_data');

Step 2:) Save and you are done.

Customization:

You just have to replace +++ENCODED HTML CODE HERE+++ with your desired content. You must have to add encoded HTML/JavaScript/JQuery code here ot can add Text too. To encode your code, just use out HTML Code Encoder to encode your code and use the encode cvode in above code.

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.

Recommended For You:
10 WooCommerce Plugins You Can't Ignore In ECommerce Era

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...

Be the first to write a comment.

Leave a Reply

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