How to Add Signature or Ads after Post Content in WordPress

Recently one of our users asked on our facebook page, how to add signature after post content in WordPress. There are a lot of ways you can do this, but we will share the most efficient method that will work for almost all themes. In this article, we will show you how to add signature or ads after single post content in WordPress.
All you have to do is add the following code in your theme’s functions.php file or in a site-specific plugin.
//Add Signature Link
function custom_content_after_post($content){
if (is_single()) {
$content .= '<p>Load Your Content Here</p><img src="'. get_template_directory() .'/images/signature.png" alt="Your Name" />';
}
return $content;
}
add_filter( "the_content", "custom_content_after_post" );
All you have to do is change the code after the = sign. You can use it to place an image like we did above. You can use it to add ads. This is by far the simplest way of doing so which will work in parent themes as well as child themes of popular frameworks like Genesis, Thesis etc.
Note: if you are using a child theme, and your image is stored in your child theme’s images folder then replace get_template_directory with get_stylesheet_directory.
If you don’t like to code, then you can use one of the many plugins that are available such as FT Signature Manager or WordPress Signature.
Lastly, if you were wondering how to add ads within post content (such as after the first paragraph of your post), then check out our article on how to insert ads within WordPress post content.






Hi, just question…for a very early beginer…;) Where exactly do I add the code? when I open the function editor I see a lot of code an I do not know where I have to paste it.
Just other question, I would like to put something like ” subscribe to us, is more confortable to rececive the news by email” ( and add an emoticon I have with a plug in). Can I do it adding the text+emoticon simply?
Thank you very much, I love this page!
You should look at our Beginner’s Guide to Pasting a Code Snippet. Sure you can put whatever type of content you like using this technique.
What if you wanted this to only show in a certain directory? For example, we have a Q&A section that we would like to occasionally include promotions to books, seminars, etc. Can this function be changed so that it will only add the signature if it is for a path such as http://www.website.com/qanda/?
Sure it can. You can add multiple conditionals. So it can be if(is_single() && in_category(’4′))
Replace the category id with whatever you like. http://codex.wordpress.org/Conditional_Tags#A_Category_Page << here is info on more conditional tags.
Nice artilce, but the thing is when we add it this way and using some other plugins, who are also taking part in this filter to add content after content, how to order those content filters.How to make the one you are adding stand first in priority than others.
Ahmad Awais, you can specify the priority in the code.
http://codex.wordpress.org/Function_Reference/add_filter << Here is the reference.