This week wanted to show you how to add a signature to your blog posts. Adding a signature to your blog posts just gives your post a more personal feel, and you have probably noticed pretty much all the best blogs have one. This is easy enough to do.
HOW TO ADD A SIGNATURE TO YOUR BLOG POSTS
Now these steps for how to a signature to your blog posts are for if you are using the Genesis framework. You would need to adjust the code a little if you are not using Genesis framework
- Create the signature image you want to use
You have several options on how you can create your signature image
Tip: It is best to save the image as a .png file
- Use graphic software like Pic Monkey or Photoshop
- Sign a piece of paper & scan it
- Use an app like Docusign Inc. I used the Docusign Inc app on my phone, and emailed my signature to myself (I know I am a techy dork).
- Upload your signature image to your media library
- Paste the following code into your functions.php file
(Found this code at Pretty Darn Cute Design a while back)
// Add Signature Image after single post
add_action('genesis_after_entry_content', 'custom_include_signature', 1);
function custom_include_signature() {
if(is_single()) { ?>
<img src="Your URL" alt="Signature" />
<?php }}
Tip: The highlighted part is all you will need to change. You just change it to the URL of your signature.
Save your functions.php file, and now you will see your signature at the bottom of all your post.
MAKING SIGNATURE SHOW UP ON YOUR PAGES
If you would like to also have the signature show on your pages as well you can use this code instead.
// Add Signature Image after single post
add_filter('the_content','add_signature', 1);
function add_signature($text) {
global $post;
if(($post->post_type == 'post') || ($post->post_type == 'page'))
$text .= '<div class="signature"><img src="Your URL"></div>';
return $text;
}
This will put the signature on all pages. If you do not want to see the signature on certain pages you can use CSS to remove your signature from those pages.
Hope you found this trick helpful.
Have a tutorial you would like to see on a future Tuesday Tutorial? Click here to send a request.