Facebook social context

Social Context is a new Facebook Plugin widget (release summer 2012 ) that show related Friends for a topic . Experimented with that widget on the wordpress blog the combination with the WP tags looked most reasonable for me . Since these is a Plugin still in development results are not all time acurate if facebook cant find related user or topic for your Tag . here a short codesnipet how i integrated it on a singel post view . It takes the first Tag and show Facebook Social context box . Social conext box is similar to the Page widget with the difference that the user shown are topic related instead of Page. Could grow to a intersting plugin as you know what friends would like to read your post too. 

General format :

<fb:social-context keywords="vienna"></fb:social-context>

Code snippet for WP singel.php add it where ever you want to social context show up. The code snipet auto add the box with the first Tagg as keyword


$posttags = get_the_tags();
$count=0;
if ($posttags) {
foreach($posttags as $tag) {
$count++;
if (1 == $count) {
echo "<fb:social-context keywords='";
echo $tag->name . ' ';
echo "' size='large' data-width='600'></fb:social-context>";
}
}
}

 

ref . Facebook Plugins Widgets

read more on  DeveloperTom Waddington Blog  

SAY HELLO

avatar
  Subscribe  
Notify of