Tagged: x
-
AuthorPosts
-
September 4, 2016 at 8:11 am #1160538
bartvanoersParticipantHey friends,
I want to change the language of the Facebook Comments Plugin. I used this code:
if ( ! function_exists( 'x_facebook_sdk' ) ) : function x_facebook_sdk() { require( X_FACEBOOK_COMMENTS_PATH . '/functions/options.php' ); ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '<?php echo $x_facebook_comments_app_id; ?>', xfbml : true, version : 'v2.1' }); }; (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/nl_NL/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <?php } endif;found in this post, but it doesn’t work. I also made the adjustment in plugins/x-facebook-comments/functions/output.php but also no effect. When I check it in Safari/Chrome inspector it still says en_US instead of nl_NL.
Any clues?
September 4, 2016 at 8:12 am #1160540
bartvanoersParticipantThis reply has been marked as private.September 4, 2016 at 9:32 am #1160588
ThaiModeratorHi There,
Please find this code under functions.php file:
if ( ! function_exists( 'x_facebook_sdk' ) ) : function x_facebook_sdk() { require( X_FACEBOOK_COMMENTS_PATH . '/functions/options.php' ); ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '<?php echo $x_facebook_comments_app_id; ?>', xfbml : true, version : 'v2.1' }); }; (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/nl_NL/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <?php } endif;And change to this:
function x_facebook_sdk() { require( X_FACEBOOK_COMMENTS_PATH . '/functions/options.php' ); ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '<?php echo $x_facebook_comments_app_id; ?>', xfbml : true, version : 'v2.1' }); }; (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/nl_NL/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <?php }Hope it helps 🙂
September 4, 2016 at 9:52 am #1160612
bartvanoersParticipantThanks! But it doesn’t work.
The site is now over here by the way.
September 4, 2016 at 4:52 pm #1160858
RadModeratorHi there,
There are two instances of SDK declaration. One for EN and one for NL, and EN is loaded first ignoring the second one. Do you have other customizations that deal with Facebook API? Would you mind providing your FTP login credentials as well?
Thanks!
September 4, 2016 at 5:18 pm #1160874
bartvanoersParticipantThis reply has been marked as private.September 4, 2016 at 11:01 pm #1161107
LelyModeratorHi There,
Thank you for the admin credentials.
I did check and even update your code to this:if ( ! function_exists( 'x_facebook_sdk' ) ) : function x_facebook_sdk() { require( X_FACEBOOK_COMMENTS_PATH . '/functions/options.php' ); ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '<?php echo $x_facebook_comments_app_id; ?>', xfbml : true, version : 'v2.1' }); }; (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/nl_NL/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <?php } endif;That same code is working on my test site. Then I found out that you have Simple Share Buttons Adder plugin too. This plugin might be loading facebook SDK too. Please try disabling this and then check if it works.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1160538 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
