Tuesday , 2 September 2014
Hot!
Home » How-To & Hacks » Quick Tip: Add Your Own Signature Into WordPress Post

Quick Tip: Add Your Own Signature Into WordPress Post

One of the ways you can bring personal touch into your WordPress site is by including your signature after the content of your blog posts. But it can be troublesome if you have to do it manually each time you publish new post.

Signature in WordPress post

So, for this edition of Quick Tip, I want to share with you how you can automatically include your signature after the content of your blog posts.

First, you have to create the signature and upload it into WordPress site. The best way to do this is by using GIMP software and then uploads it into your WordPress site by clicking on the Media tab of your site dashboard.

Then, copy and paste the code snippet below into your functions.php (Appearance Tab > Editor > functions.php)

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;
}

Before you save the adjustment you made with your functions.php file, change the image url that I have highlighted above with image url of your own signature that you have uploaded earlier on.

And that’s all. You can now have your own signature in every post of your WordPress site. Enjoy!

Credit: WPMU

300 x 250 #1 300 x 250 #1

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>