-
AuthorPosts
-
March 23, 2019 at 2:33 pm #1082118
Dear Kriesi Team, my issue is complicated, but I think it’s an important topic.
So I’m using your theme on more websites already, but for the first time I have to add FB like and share button to some templates. As I know after upgrading the site the templates are getting refreshed too, so I made a child theme, and copied the already edited template-files into the child theme folder. I know it should work after updating too, but thing is, that somehow the buttons are not showing up on the page, even if I tried to edit the original template files too, and place the code into it…
…for example to into the header.php right after the body closing tag I placed the code “<div id=”fb-root”></div>
<script async defer crossorigin=”anonymous” src=”https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.2″></script>” – which means I can place the buttons with this one whenewer I want to appear on my site… “<div class=”fb-like” data-href=”https://www.facebook.com/pg/T%C3%A9likert-%C3%A9s-Pergola-Szak%C3%A9rt%C5%91-188637232030736/” data-layout=”button” data-action=”like” data-size=”large” data-show-faces=”true” data-share=”true”></div>”This second code contains the FB page which is made in hungarian language, so for the WPML-translated slovak version I’d be able to place another type of code with the link of the FB page which is made in Slovak language.
I think this would be the best option to solve my case, but the buttons are just not showing up at all for me, and I don’t know why. Maybe my topic is just theme-related because the template-files changes, but I think there’s an other issue. I was trying to use the “WP like button” plugin too, and on its configuration page it should show the preview of the buttons too, but it haven’t showed it in there too. Maybe this helps to find the solution.
Until that time I reversed all the changes on my site, but in case it’s not a common problem, I can do my solution again and send you my login credentials.
I hope, that I haven’t bored you, but I wanted to be detailed to make things easier. Thanks for your kind help.
Thomas Zsitva
March 27, 2019 at 10:20 am #1083499Hey blacknetguy,
There’s a hook called ava_after_body_opening_tag which you can use for the same purpose, here’s an example of how to use it:
function after_body_opening_tag_fn(){ echo '<div id="fb-root"></div>'; } add_action('ava_after_body_opening_tag', 'after_body_opening_tag_fn');
so you don’t need to modify header.php and just make changes inside your child theme’s functions.php
What you suggested also works (and if hooks are not available this would be a goto solution) the only problem I see with it is when there are new changes in Enfold’s header.php file, you’ll need to update your header.php file again then re-add the modifications made.Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.