• GoDaddy Community
  • Websites + Marketing | Website Builders
  • Websites + Marketing | Website Builders

    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution

    How can I add the Facebook Social Plugin to my webpage

    Is it possible to add the Facebook Social Plugin to my webpage.  I added the following code to my web page using the HTML widget but it is not working.  I am wondering if it is because the first section of the code needs to be inside the BODY tag.


    Step 1: Include the JavaScript SDK on your page once, ideally right after the opening body tag.

    <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 = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0';  fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    Step 3: Place this code wherever you want the plugin to appear on your page.
    <div class="fb-page" data-href="https://www.facebook.com/MyFB/" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"></div>


    3 REPLIES 3
    Community Manager
    Community Manager

    Re: How can I add the Facebook Social Plugin to my webpage

    Hey @andytai. Thanks for being part of GoDaddy Community! I was able to get this to work. When you get the code for the app, there should be an option to chose between Javascript SDK and Iframe. What you have above is the Javascript code. I couldn't get that to work either. But, when I used the code from the Iframe option, it worked fine. Hope that helps!


    JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.
    Super User II Super User II
    Super User II

    Re: How can I add the Facebook Social Plugin to my webpage



    Hmmm.... The HTML tab can accept JavaScript and it states it would inject the script *between* the body tags.  Your notes does indicate "ideally right after the opening tag" so I would make sure that HTML widget is the first thing you add on that page.


    Then for the display snippet put that in another HTML widget where you want it to display.


    If that doesn't work then only GoDaddy can advise why.  Maybe that type of script is not compatible with the GoCentral interface?


    HTH! 😉


    "Do or do not. There is no try." ~Yoda

    Re: How can I add the Facebook Social Plugin to my webpage

    Thanks Jesse.  Using the code from the iframe option works for me as well.