Create a handwritten signature with a WordPress shortcode
Did you ever want to add a handwritten signature to your posts just like you would when signing a letter? Here’s a nice code snippet to create a “signature” shortcode.
First, you have to get a signature image. To do so, scan your signature or create one using your favorite photo editor. Once you have it, name it signature.jpg and upload it into your wp-content/themes/yourtheme/images directory.
Then, open the functions.php file from within your theme. If your theme doesn’t have that file, just create it. Paste the following code in it:
function sc_signature() {
return '<div id="signature"></div>';
}
add_shortcode('signature', 'sc_signature');
Last, define the style for the #signature id by adding the following code to your style.css:
#signature {
background:url(images/signature.jpg) no-repeat top left;
width:100px;
height:100px;
}
Note: You may have to edit the width and height to fit your image size.
Now, when you’ll want to insert your signature at the end of a post, simply switch WordPress editor to HTML mode and type the following:
[signature]
Here it is in action…



Nice tip – I’m guessing you could do that with any image, such as headshots of routine guest authors by naming #headshotbill, etc.
How would I change alignment? I would like it to align right. I Tried to edit that directly in style sheet but wouldn’t work. Any help would be much appreciated.
Aaron …
You can just add
float:right;to the css and that will align it right.Good luck! WeFixWP
Thanks for this tip. I have done everything as shown above and now my signature is at the bottom of my posts.
I guess if you have multiple authors then you can create more shortcodes
How would you center the signature?
How to make this happen if you have multiple authors on one blog?
Is there any easy way for a non coder?
You can just modify the code and repeat it however many times you need (signature1, signature2, etc.). For example…
function sc_signature1() {return '';
}
add_shortcode('signature1', 'sc_signature1');
you also need to save each signature as a separate image and add the css for each one…
#signature1 {background:url(images/signature1.jpg) no-repeat top left;
width:100px;
height:100px;
}
you would then use the short code…
[signature1]
Hope that helps!
[...] wefixwp hittade jag en manual som förklarade bra om hur man gör och så här gick jag tillväga för att [...]
When you use this function, does the signature also appear in feed that gets emailed to subscribers? I currently have an automatic signature line that I just inserted into my subscribe reminder plugin. But that entire plugin doesn’t show up in emailed posts. Help? Thanks.
[...] Create a handwritten signature with a WordPress shortcode by wefixwp [...]