How to make a ‘share this post on facebook’ link in WordPress

This tips applies to coding a WordPress theme design. You won’t be able to copy and paste the code straight into your posts. You will need full access to editing themes on your server (yes, I can host WordPress sites if you contact me).

<a target=”_blank” href=”http://www.facebook.com/sharer.php?u=<?php echo urlencode(get_permalink(get_the_ID())); ?>&amp;t=<?php echo urlencode(get_the_title(get_the_ID())); ?>”>Share this post on facebook</a>

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Leave a Comment