Tagged: x
-
AuthorPosts
-
April 12, 2016 at 4:35 pm #878974
Ryandm1983ParticipantHi Team X
Ive recently installed the X child theme as advised by research done on the forum. This is so i can edit the functions.php file without affecting the main theme. However as i attempted to make edits and save i now can not access the domain through a browser at all. I added a single letter, just to test if it would save & now site is down !
This is the error i get.
“Parse error: syntax error, unexpected ‘<‘ in /usr/www/users/vayadpumft/genesishotel.vayadata.co.za/wp-content/themes/x-child/functions.php on line 26”Hoping & praying for a quick solution – thank you!
April 13, 2016 at 3:25 am #879584
Ryandm1983ParticipantRight so, i figured out that the syntax error was from the JavaScript SDK code i added from facebook.
I replaced the functions.php file via ftp and site is back.So now, i’m pasting the Facebook code exactly as expressed via the forum & Facebook, but the code is not working ?
I suppose the question now is why cant we integrate Facebook widget code successfully ?
April 13, 2016 at 4:24 am #879656
ThaiModeratorHi There,
Please try with this code, add it under functions.php file locate in your child theme:
add_action( 'x_before_site_begin', 'x_facebook_sdk' ); function x_facebook_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.6&appId=490866727757684"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <?php }Hope it helps 🙂
April 13, 2016 at 2:49 pm #880726
Ryandm1983ParticipantThanks Thai
Ummm, didnt seem to work, or at least the page ran really slowly. Strange enough when i added the SDK above the html all in the same text element it worked.
Thanks for your help.
April 13, 2016 at 11:46 pm #881431
Paul RModeratorHi,
Facebook recommends inserting it directly after the opening <body> tag thus it is inserted in x_before_site_begin.
Kindly review this link – https://developers.facebook.com/docs/javascript/quickstart/v2.6
Thanks
April 19, 2016 at 3:00 am #889484
Ryandm1983ParticipantThanks so much !
April 19, 2016 at 7:34 am #889904
DarshanaModeratorGlad we were able to help 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-878974 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
