【发布时间】:2014-02-05 10:58:56
【问题描述】:
我遇到的一个问题是我的标题包含一个“&”,但当我点击分享时它显示为“&”。
我遇到的另一个问题是下面的代码无法识别“
”或“\n”。
如何让它能够识别“&, ', -, etc..”以及换行符。
<?php
$gettitle = get_the_title();
$getcontent = get_the_content();
$content = substr($getcontent, 0, 20);
$content .= "<br>".$moretexthere;
$link = get_permalink();
$title=urlencode($gettitle);
$url=urlencode($link);
$summary=urlencode($content);
?>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">Share</a>
【问题讨论】:
标签: php facebook wordpress share