我正在尝试将 facebook like 按钮附加到我博客上的每个帖子中。我已经设法获得添加喜欢按钮所需的任何东西,我唯一需要的是,我如何访问函数内的当前帖子的链接,author_bio_display($content)
即在它说的地方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");