Tagged: x
-
AuthorPosts
-
September 19, 2016 at 3:28 am #1181030
Gerald EParticipantHi,
I want to add the facebook page plugin.
found the code here: https://developers.facebook.com/docs/plugins/page-pluginbut its not showing. can you pls help?
Gerald
September 19, 2016 at 3:32 am #1181035
Gerald EParticipantThis reply has been marked as private.September 19, 2016 at 3:42 am #1181044
ChristianModeratorHey Gerald,
You can utilize the
x_before_site_beginX hook to add code after the <body> tag. Here’s a sample code to add the Facebook SDK after the body tag.add_action( 'x_before_site_begin', 'x_fb_sdk' ); function x_fb_sdk() { ?> <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/sdk.js#xfbml=1&version=v2.7&appId=1013301275369541"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <?php }Once that’s added, you can add the code below in a Raw Content element
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&src=sdkpreparse">Share</a></div>This has been tested on my test site and it works. Please take note though that this is only a guide and you might need a different code depending on your setup.
If you’re not comfortable with coding, you might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/
Thanks.
September 19, 2016 at 11:59 am #1181720
Gerald EParticipantThank you so much! I will try this but how can I add the first part (code after the body tag) with X or in wordpress?
September 19, 2016 at 12:11 pm #1181736
RahulModeratorHey There,
Thanks for writing back!
Make sure you directly paste this code to functions.php in your Child Theme file and Raw content element in Cornerstone respectively.
Hope it helps!
Let us know how it goes!
September 19, 2016 at 12:11 pm #1181738
RahulModeratorHey There,
Thanks for writing back!
Make sure you directly paste this code to functions.php in your Child Theme file and Raw content element in Cornerstone respectively.
Hope it helps!
Let us know how it goes!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1181030 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
