Note that there are some explanatory texts on larger screens.

plurals
  1. POGet OpenGraph to POST OnLoad
    primarykey
    data
    text
    <p>Help! I'm trying to connect my blog and Facebook through OG. I have Wordpress running on my server. I have it set up now so that the user authenticates and then clicks a button to share the page. I want it so once they authenticate, Wordpress will automatically POST to OG about what they've read. In header.php, I set the body tag so when it loads, it will execute this:</p> <pre><code>&lt;?php if (is_single()) { ?&gt; &lt;script&gt; function load() { FB.api( '/me/my_blog_int:read?post=&lt;?php the_permalink() ?&gt;', 'post', function(response) { if (!response || response.error) { alert('Error occured'); } else { alert('Post was successful! Action ID: ' + response.id); } }); } &lt;/script&gt; &lt;?php } ?&gt; </code></pre> <hr> <p>this is the top of the body section on my header.php</p> <pre><code>&lt;body &lt;?php body_class(); ?&gt; onload="load()"&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt; window.fbAsyncInit = function() { FB.init({ appId : 'MY-APP-ID-IS-HERE', // 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:add-to-timeline&gt;&lt;/fb:add-to-timeline&gt; </code></pre> <p>What do I do?? All I get is the Error occured message. The way in which the button is clicked works perfectly, its just not the functionality I want. Please let me know if you need any more code or information. And if you're wondering... Yes, I have the rest of the FB code, I just didn't post it as this segment seems to be causing the problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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