三十一有the_title()
返回一些文本,在這種情況下Blue & Whiny
php,如何將特殊字符轉換爲文本?
我們可以看到的問題是,&角色看起來與衆不同
如何打開Blue & Whiny
爲Blue & Whiny
我tryed:htmlspecialchars_decode(the_title())
,html_entity_decode(the_title())
,htmlspecialchars(the_title())
沒事了。
我想&
轉換爲&
沒有太多的代碼共享,我只是這樣做:<?php the_title() ?>
,我也得到Blue & Whiny
。如果我使用get_the_title()
它不會顯示任何東西
任何想法? 謝謝
edit1。生病分享一些代碼:
<script type="text/javascript">
function showShareUI() {
var act = new gigya.services.socialize.UserAction();
act.setUserMessage("Check out this article.");
act.setTitle("Trends on Explore Talent - <?php the_title(); ?>");
act.setDescription("<?php get_the_content(); ?>");
act.setLinkBack("<?php the_permalink(); ?>");
act.addActionLink("Check out this article", "<?php the_permalink(); ?>");
var image = {
src: 'http://xxx.com/wp-content/uploads/2011/05/BOTTOM_BANNER.jpg',
href: '<?php the_permalink();?>',
type: 'image'
}
act.addMediaItem(image);
var params =
{
userAction: act, // The UserAction object enfolding the newsfeed data.
onError: onError, // onError method will be summoned if an error occurs.
onSendDone: onSendDone // onError method will be summoned after
,showEmailButton: true
// Gigya finishes the publishing process.
};
gigya.services.socialize.showShareUI(conf, params);
}
function onError(event) {
alert('An error has occured' + ': ' + event.errorCode + '; ' + event.errorMessage);
}
function onSendDone(event)
{
document.getElementById('status').style.color = "green";
document.getElementById('status').innerHTML = 'The newsfeed has been posted to: ' + event.providers;
}
</script>
我試過了一切。這開始困擾我...
你嘗試過'html_entity_decode(the_title())'它自己嗎?如果是的話,結果是 –
我做了什麼,我試過所有單獨的,它不會解碼 – Patrioticcow
你想要顯示'藍色& Whiny' as'Blue&Whiny'或做別的事情? – Balanivash