Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1399420
    s_gogos
    Participant

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

    #1399486
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Please check this instructions here (https://community.theme.co/forums/topic/facebook-sdk-2/#post-1258594).

    Hope that helps.

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