Getting the permalink to the post in wordpress
I am trying to append the facebook like button to each of the post on my
blog. I have managed to get whatever I need to add the like button, the
only thing I need is, how can I access the current post's link inside the
function author_bio_display($content) i.e. at the place where it says
rawurlencode('post permalink goes here')?
function author_bio_display($content)
{
$bio_box = '<iframe
src="http://www.facebook.com/plugins/like.php?href='.
rawurlencode('post permalink goes here')
.'&layout=standard&show-faces=true&width=450&action=like&font=arial&colorscheme=light"
scrolling="no" frameborder="0" allowTransparency="true"
id="facebook-like"></iframe>';
return $content . $bio_box;
}
add_action("the_content", "author_bio_display");
No comments:
Post a Comment