How to Add a Signature to Your WordPress Posts

Adding a signature to your WordPress posts is one way to give your blog a more personal touch. The code below will automatically include your signature after the content of your blog posts so that you don’t have to manually add it every time. Here’s an example result:

Copy this code and paste it into your functions.php file:

1
2
3
4
5
6
7
8
add_filter('the_content','add_signature');
function add_signature($text) {
global $post;
if($post->post_type == 'post') $text .= '<div class="signature">
<img src="http:/yoursite.com/wp-content/themes/yourtheme/images/signature.png" alt="signature" />
</div>';
return $text;
}

Make sure to change the image URL to the location of your image, or you can replace the image tag with plain text.

Tweak via CSS as needed…

If you have any issues with the placement or appearance of your signature, you can style it with CSS. For example:

1
2
3
div.signature img {
padding: 5px;
}

The best part is that there’s no need to add a new plugin to accomplish this. Simply copy and paste and your signature will be automatically included. Update the image any time you like and it will be dynamically changed on all posts on your blog.