Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1181030
    Gerald E
    Participant

    Hi,

    I want to add the facebook page plugin.
    found the code here: https://developers.facebook.com/docs/plugins/page-plugin

    but its not showing. can you pls help?

    Gerald

    #1181035
    Gerald E
    Participant
    This reply has been marked as private.
    #1181044
    Christian
    Moderator

    Hey Gerald,

    You can utilize the x_before_site_begin X 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.

    #1181720
    Gerald E
    Participant

    Thank 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?

    #1181736
    Rahul
    Moderator

    Hey 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!

    #1181738
    Rahul
    Moderator

    Hey 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!

  • <script> jQuery(function($){ $("#no-reply-1181030 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>