Facebook integration into wordpress

1,550 views

Published on

Some notes on integrating Facebook Open Graph into Wordpress. Also notes on how to use facebook API to put comments on the site as opposed to just in the iframe.

Published in: Self Improvement, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,550
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Facebook integration into wordpress

  1. 1. Facebook Integration into Wordpress
  2. 2. FB Open Graph Protocol <ul><li>http://developers.facebook.com/docs/opengraph/ </li></ul>
  3. 3. FB Open Graph Protocol <ul><li>ADD THE HEADER </li></ul><ul><li><html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:og=&quot;http://ogp.me/ns#&quot; xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;> </li></ul>
  4. 4. FB Open Graph Protocol <ul><li>ADD META TAGS </li></ul><ul><li><!-- Open Graph FBML --> </li></ul><ul><li><meta property=&quot;og:title&quot; content=&quot;&quot;/> </li></ul><ul><li><meta property=&quot;og:type&quot; content=&quot;website&quot;/> </li></ul><ul><li><meta property=&quot;og:url&quot; content=&quot;&quot;/> </li></ul><ul><li><meta property=&quot;og:image&quot; content=&quot;logo image&quot;/> </li></ul><ul><li><meta property=&quot;og:site_name&quot; content=&quot;&quot;/> </li></ul><ul><li><meta property=&quot;fb:admins&quot; content=&quot;USER_ID&quot;/> </li></ul><ul><li><meta property=&quot;og:description&quot; content=&quot;&quot;/> </li></ul><ul><li><meta property=&quot;fb:admins&quot; content=&quot;&quot; /> <meta property=&quot;fb:page_id&quot; content=&quot;&quot; /> </li></ul>
  5. 5. FB Open Graph Protocol <ul><li>Like Button: </li></ul><ul><li><fb:like href=“liked-url.com/&quot; width=&quot;450&quot; height=&quot;80&quot;/> </li></ul><ul><li>Comments: </li></ul><ul><li><fb:comments class=&quot; fb_iframe_widget&quot; width=&quot;600&quot; num_posts=&quot;100&quot; href=&quot;http://commented-url.com&quot;> </li></ul>< ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?> < ? php comments_template(); ?>
  6. 6. Wordpress <ul><li>WHERE DO I PUT THIS STUFF? </li></ul><ul><ul><li>Header.php </li></ul></ul><ul><ul><li>page.php </li></ul></ul>
  7. 7. Wordpress <ul><li>Xml header and meta tags paste into header.php </li></ul><ul><li>Js script (like, comment, etc) – paste into page.php (comments template();) </li></ul>
  8. 8. Wordpress <ul><li>Important WP variables </li></ul><ul><li>wp_title(); </li></ul><ul><li>get_permalink(); </li></ul><ul><li>bloginfo('description'); </li></ul><ul><li>the_excerpt_rss(); </li></ul>
  9. 9. FB WHERE’S MY SEO? <ul><li>Social Plugins are iframes </li></ul>
  10. 10. FB API <ul><li>Returns Objects </li></ul><ul><li>Example: comment Object </li></ul><ul><li>https://graph.facebook.com/comments/?ids=URL </li></ul>
  11. 11. FB API <ul><li>Object Comment documentation </li></ul><ul><li>http://developers.facebook.com/docs/reference/api/Comment/ </li></ul>
  12. 12. FB API <ul><li>FB Object to array </li></ul><ul><li>$decoded=json_decode(file_get_contents(&quot;https://graph.facebook.com/comments/?ids=<?php echo get_permalink(); ?>&quot;),true); </li></ul>
  13. 13. PLUG IT IN <ul><li>WP standard documentation </li></ul><ul><li>Add_action($hook, array($class, $method)) </li></ul>
  14. 14. FB Open Graph Protocol <ul><li>http://developers.facebook.com/docs/opengraph/ </li></ul>

×