Top

Daily Tip: How to Add a Signature to Your WordPress Posts

April 23, 2011

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:

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:

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.

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.