[英]Share This API Facebook Share Image not showing
我使用“共享此API”來共享社交按鈕。 一切都好。 他們都共享正確的內容。 但是,除了facebook共享圖像外,不能將其注冊為og屬性的一部分。 顯示facebook彈出共享時,沒有圖像顯示。 有人可以幫忙嗎? 提前致謝!
實際上,我只是遵循了客戶端提供的模板,並且我不想盡可能地更改API /插件。 而且我在API的站點http://developer.sharethis.com/中找不到任何有關此類服務的文檔。
這是代碼。
<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=71dfd17f-04ad-4bd7-acfc-7a47e609cc6f&type=website&post_services=email%2Cfacebook%2Ctwitter&button=false"></script>
<script type="text/javascript">
var BASE_URL = "http://mydemosite.com/";
var shared_object1 = SHARETHIS.addEntry({
title:"My Site | This is showing in fb debugger",
url: BASE_URL,
summary:'My summary. This is showing in fb debugger.',
content:'My Content. This is showing in fb debugger.',
image: BASE_URL + 'share.png'
});
console.log(BASE_URL + 'share.png'); //This returns exactly the url of the image
shared_object1.attachChicklet("email", document.getElementById("share_email"));
shared_object1.attachChicklet("facebook", document.getElementById("share_fb"));
shared_object1.attachChicklet("twitter", document.getElementById("share_twitter"));
</script>
我還簽入了Facebook的調試器。 og:屬性下未列出任何圖像。 https://developers.facebook.com/tools/debug
現在,當我也在<head>
標記中進行硬編碼時,它也可以工作:
<meta property="og:image" content="<?php echo $base_url; ?>share.png"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.