Tagged: enfold, facebook, facebook group, sdk
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.
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
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.
I would like to place the code in one of my footer widgets. Thank you.
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