Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom title, summary is not working in facebook sharer

I had links in my website which were working fine but I noticed that these are not working now.

eg : http://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://www.otlcampaign.org/blog/2013/02/04/inconvenient-truth-education-reform&p[images][0]=http://www.otlcampaign.org/sites/default/files/journey-for-justice-mlk-memorial.jpg&p[title]=The+Inconvenient+Truth+of+Education+'Reform'!&p[summary]=Recent+events+have+revealed+how+market-driven+education+policies,+deceivingly+labeled+as+%22reform,%22+are+revealing+their+truly+destructive+effects+on+the+streets+and+in+the+corridors+of+government:

this link was working fine before but its not taking custom title , summary etc. Please help me to resolve this problem.

I'm not using meta tags because there are lot of share buttons which have different title, description, image urls.

I have already gone through existing question on this site but those solutions are obselete. eg Facebook Share doesn't show my description or my thumbnail Any suggestions please.

like image 798
user270014 Avatar asked Jan 09 '14 17:01

user270014


1 Answers

I'm not sure if you're comfortable with using PHP, but have you tried the following?

<?php
       $title=urlencode('Title');
       $url=urlencode('http://www.facebook.com/yourfanpage'); /* Note Personal FB Pages will not work */
       $summary=urlencode('Custom message');
       $image=urlencode('http://www.yourdomain.com/facebookshare/images/customthumbnail.jpg');

?>


<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>&amp;p[summary]=<?php echo $summary;?>&amp;p[url]=<?php echo $url; ?>&amp;&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">
                Share our Facebook page!
</a>

From your example, also, I noticed that one of the issues might be the ampersands. You have 100& instead of 100& You will need to double check all of the links for these and the spaces, etc.

like image 109
andrejohannsen217 Avatar answered Sep 30 '22 12:09

andrejohannsen217