Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to publish an article using Open Graph to timeline?
    text
    copied!<p>I've been working tirelessly for the last eight or so hours trying to format my Wordpress blog in a way that means that a user can click a button and publish the article to a ticker, by using the Open Graph settings for Article.</p> <p>I have been using the tutorial found <a href="http://developers.facebook.com/docs/opengraph/tutorial/" rel="nofollow">here</a>.</p> <p>Unfortunately, I have not been able to complete it as every time I click the "Publish" button I have created, I get an error message pops up.</p> <p>When using Facebook's debugger I see no problems and all the necessary tags are in place (I have a plugin that does it for me, which is perfect).</p> <p>Here are the alterations I have made to my <code>header.php</code> file to fit in with the tutorial:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"&gt; </code></pre> <p>Added the following before <code>&lt;/head&gt;</code>:</p> <pre><code>&lt;script type="text/javascript"&gt; function postArticle() { FB.api( '/me/[NAMESPACE]:read?Article=&lt;?php get_permalink() ?&gt;', 'post', function(response) { if (!response || response.error) { alert('Error occured'); } else { alert('Successful! Action ID: ' + response.id); } }); } &lt;/script&gt; </code></pre> <p>Placed a login button clearly that asks permission:</p> <pre><code> &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt; window.fbAsyncInit = function() { FB.init({ appId : '[APPLICATION ID]', // App ID status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); &lt;/script&gt; &lt;fb:login-button perms="email,publish_actions,user_actions.news"&gt; Login with Facebook &lt;/fb:login-button&gt; </code></pre> <p>And finally placed the following at the point on the page where I want the button to appear:</p> <pre><code>&lt;fb:add-to-timeline&gt;&lt;/fb:add-to-timeline&gt; &lt;form&gt; &lt;input type="button" value="Publish" onclick="postArticle()" /&gt; &lt;/form&gt; </code></pre> <p>On my Open Graph settings, I have the action type 'Read' as well as the object type 'Article'.</p> <p>How come this isn't working for me?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload