Wordpress: Custom Signature on Posts

WordPress: Custom Signature on Posts

Do you ever read blogs that have a custom image or signature on the bottom of the posts? Well, if you have a WordPress blog and want to add your own custom signature on your posts, it’s really easy to do!

Edit your theme’s functions.php file

add_filter('the_content','post_signature'); 
function post_signature($signature) { 
    global $post; 
    if($post->post_type == 'post') 
    /* This is where you add the signature code. If you want to add text instead of an image, 
    just replace the <img> tag with your custom text. */
    $signature .= '<div class="signature"><img src="IMAGE URL" alt="ALT GOES HERE" /></div>'; 
    return $signature; 
}

You can replace the <img> tag with any content you want to add as your signature (custom text, quote, etc). Don’t forget to customize the styling (alignment and other properties) of the signature using the .signature CSS class.

That’s it! If you have any comments or questions, make sure to leave a comment!

Leave a Comment

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