Tagged: x
-
AuthorPosts
-
March 8, 2017 at 12:16 pm #1399420
s_gogosParticipantHello guys I am having a problem when trying to share content from my website on Facebook.
I have copied some code I found here on your support and I’d like you to check it if you can and tell me if there is something wrong with it 🙂
This is how the functions.php file in the child theme looks like:<?php
// =============================================================================
// FUNCTIONS.PHP
// —————————————————————————–
// Overwrite or add your own custom functions to X in this file.
// =============================================================================// =============================================================================
// TABLE OF CONTENTS
// —————————————————————————–
// 01. Enqueue Parent Stylesheet
// 02. Additional Functions
// =============================================================================// Enqueue Parent Stylesheet
// =============================================================================add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ );
// Additional Functions
// =============================================================================/*Facebook SDK*/
add_action( ‘x_before_site_begin’, ‘x_print_fb_sdk’ );
function x_print_fb_sdk(){
?>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : ‘ID’,
xfbml : true,
version : ‘v2.8’
});
};(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”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));
</script><?php
}add_filter( ‘jetpack_enable_open_graph’, ‘__return_false’, 99 );
Is it OK? (I replaced my app ID with “ID”)
Thank you!March 8, 2017 at 1:19 pm #1399486
DarshanaModeratorHi there,
Thanks for writing in! Please check this instructions here (https://community.theme.co/forums/topic/facebook-sdk-2/#post-1258594).
Hope that helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1399420 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
