[Resolved] Embedding facebook image posts

Home Forums Support [Resolved] Embedding facebook image posts

Home Forums Support Embedding facebook image posts

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #147707
    Tim

    Using the Embed Post button, I got the code to an image post I want to embed on my site. However, when I put the code on a page, only the text shows up, not the image. Is there a global setting that is preventing this in the theme?
    Code of image post
    Outcome on page

    #147708
    Tim

    Links to the broken images. These are the code and the outcome on the site.

    http://postimg.org/image/bq7krh6zh/
    http://postimg.org/image/48tryis2l/

    #147733
    Tom
    Lead Developer
    Lead Developer

    Hmm, nothing in the theme preventing this, but the WP editor may be stripping something important.

    Can you link me to the page where the image isn’t showing up?

    #148292
    Tim
    #148321
    Tom
    Lead Developer
    Lead Developer

    What if you add this code to the wp_footer hook in GP Hooks?

    <div id="fb-root"></div>
    <script>
    (function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id))
            return;
        js = d.createElement(s);
        js.id = id;
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    </script>

    Then add this part to your post:

    <div class="fb-post" data-href="YOUR_URL_HERE"></div>

    Sometimes the WP editor strips out <script> tags.

    Let me know 🙂

    #593057
    Stefan

    Hi Tom,

    Having issues with this same problem, Ive copied, then edited the html (below) from the facebook developer page to footer widget 5 , which is where i want the feed to be.

    <div class="fb-page"><blockquote cite="https://www.facebook.com/facebook"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div>

    Then copied the JS SDK script into wp_footer as you have sugested . Its not presenting anything so a little confused, can you help please?

    Cheers

    #593521
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Did you add that code into a HTML widget?

    Any console errors if you right click + inspect the page?

    #593948
    Stefan

    Hi Tom,

    Yes i added the custom HTML code to footer widget 5 (can it go there?). I cannot see any errors but nothing comes up unless it is either hidden or.

    No console errors.

    Where am i going wrong?

    #594181
    Tom
    Lead Developer
    Lead Developer

    Can you link me to your site?

    #594189
    Stefan
    #594782
    Tom
    Lead Developer
    Lead Developer

    Hmm, nothing is standing out to me really.

    What’s the script you pasted into wp_footer?

    #594922
    Stefan

    Hi Tom,

    Ive pulled the script from https://developers.facebook.com/docs/plugins/page-plugin/

    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = ‘https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.0&#8217;;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));</script>

    Would this be correct?

    Thanks

    #594927
    David
    Staff
    Customer Support

    Hi Stefan, i can’t see any issue with the code but there is definitely no HTML in that widget.
    Can you test the HTML code somewhere else on the page? Try adding it via an Elementor HTML Widget in the page.

    #594964
    Stefan

    Hi David/Tom

    Ive nailed the issue, seems that it could be something wrong with the Facebook page. Ive put in some other random Facebook companies and it works fine in the footer widgets, also using the elementor html widget. So its a specific issue to the one i want to use.

    Frustrating.. very sorry!

    Cheers
    Stefan

    #594972
    David
    Staff
    Customer Support

    Hi Stefan, glad you found out what the problem is.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.