Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1073612

    Hi Kriesi

    Which code do I need to place in my Child Theme’s functions.php for the
    https://developers.facebook.com/docs/plugins/group-plugin/
    to work?

    I would like to place the

    <div class="fb-group" data-href="https://www.facebook.com/groups/mygrouptitle/" data-width="280" data-show-social-context="true" data-show-metadata="false"></div>
    in my Footer – Column widget.

    Thank you for your time.

    #1074138

    Hey waveshaper,

    Did you try to press the Get Code button to see what it gives you? We can give you a function to use after that.

    Best regards,
    Rikard

    #1090624

    Hi Rikard
    Thank you for taking the time to look into this.

    Please see below code –
    Step 2: Include the JavaScript SDK on your page once, ideally right after the opening body tag.

    <div id="fb-root"></div>
    <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=myappid&autoLogAppEvents=1"></script>

    Step 3: Place this code wherever you want the plugin to appear on your page.

    <div class="fb-group" data-href="https://www.facebook.com/groups/mygroup/" data-width="280" data-show-social-context="true" data-show-metadata="true"></div>

    Much appreciated.

    #1090629

    I would like to place the code in one of my footer widgets. Thank you.

    #1090833

    Hi,

    Please try this in your functions.php file:

    function waveshaper_add_facebook_code(){
    ?>
    <div id="fb-root"></div>
    <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=myappid&autoLogAppEvents=1"></script>
    <?php
    }
    add_action('ava_after_body_opening_tag', 'waveshaper_add_facebook_code');
    

    Then paste the second part (step 3) in your footer widget.

    Best regards,
    Rikard

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