2013-02-07 34 views
0
<a title="Share this post/page" 
href="http://www.facebook.com/sharer.php? 
s=100 

&p[url]=<?php the_permalink() ?> 
&p[images][0]= 
&p[title]=<?php the_title(); ?> 
&p[summary]=<?php the_excerpt() ?>" 
target="_blank"> 
<img src="http://www.ironwillfootball.ca/wp-content/themes/IronWillThemes/images/share_01.png" 
alt="Share on Facebook" /> 
</a> 

這是我對Facebook共享代碼的縮略圖,這條線 - > & P [圖片] [0] =爲空..我怎樣才能在此處添加圖片?如果wordpress中的縮略圖鏈接如下所示 - > img src = ID,$ key,true); ?>代碼顯示在WordPress的自定義代碼的Facebook共享者

真正的問題是我不能看到縮略圖,當我分享WordPress的一個帖子..

+0

我想要一個明確的答案。謝謝 :) – mejiwara

回答

1

首先,sharer.php已被廢棄,已經有一段時間。請記住,它可能會在任何時候停止工作。您最好使用Feed對話框進行開發。

假設您的代碼在循環中工作,您可以使用WordPress get_posts()函數返回附件。 WordPress Codex has an example這正是你正在尋找的,所以我不會在這裏重複。

如果你這樣做是外循環,你需要使用get_children()這也是described in the Codex