add common content after every wordpress post

add common content after every wordpress post

WordPress tutorial, In this article we will show, how to add common content after every wordpress post. We given simple code for adding in wordpress theme.

Just copy paste the following code in your functions.php file.  You will find this file in your wordpress theme folder.

add common content after every wordpress post


function insert_common_content($_common_content) {
if(!is_feed() && !is_home()) {
$_common_content.= "<div class='wordpressapi'>";
$_common_content.= "<h4>Enjoyed this article?</h4>";
$_common_content.= "Check more articles on <a href='http://images.purabtech.in/'>purabtech.in/files/</a>";
$_common_content.= "</div>";
}
return $_common_content;
}
add_filter ('the_content', 'insert_common_content');

add common content after every wordpress post
add common content after every wordpress post

Useful article related to this wordpress hack.

http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.