-
AuthorPosts
-
September 18, 2014 at 3:00 am #320831
Hello I want to add some custom social buttons at the bottom and top of each post and page.Where do I implement the code for that?
Facebook requires two additional steps to work properly. Add this XML namespace to the <html> tag of your website:
<html xmlns:fb=”http://ogp.me/ns/fb#”><div class=”share-buttons share-buttons-fb-like” data-style=”button_count”></div>
<div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
<div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
<div class=”share-buttons share-buttons-pinterest” data-style=”none”></div>Thanks!
September 18, 2014 at 8:26 am #320969Hi gentlemansgazette!
Thank you for using Enfold.
I’m not sure where to put the code but you can use the following plugins to add social buttons:
https://wordpress.org/plugins/socialize/
https://wordpress.org/plugins/wp-socializer/Cheers!
IsmaelSeptember 24, 2014 at 4:20 pm #324385Isamel,
I do want to use my own for tracking purposes…
We have already implemented the script via Tag Manager, and now the div is all we need to display the buttons.September 25, 2014 at 7:01 am #324810Hi!
You can use the
ava_after_content
hook, try this code in functions.php:function custom_func($context) { if($context == 'post'){ ?> social links here <?php } } add_action('ava_after_content', 'custom_func', 10, 1);
Cheers!
JosueOctober 20, 2014 at 6:21 pm #338524It’s not working :(
October 20, 2014 at 7:17 pm #338557Hi,
Can you please create us an administrator account? post it here as a private reply.
Regards,
JosueOctober 23, 2014 at 9:45 pm #340355This reply has been marked as private.October 24, 2014 at 3:14 am #340407Hi!
Can you enable file editing? or provide a FTP account so we can edit the child theme files.
Cheers!
JosueOctober 27, 2014 at 6:22 pm #341655This reply has been marked as private.October 27, 2014 at 7:23 pm #341700Hey!
It works now, i left this code in your child functions.php:
function custom_func($id, $context) { if($context == 'post'){ ?> <div> SOCIAL LINKS HERE </div> <?php } } add_action('ava_after_content', 'custom_func', 10, 2);
Best regards,
JosueOctober 27, 2014 at 8:16 pm #341738Thanks. I added the links where it says social links here but they are not showing up…
<div class=”share-buttons share-buttons-fb-like” data-style=”button_count”></div>
<div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
<div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
<div class=”share-buttons share-buttons-pinterest” data-style=”none”></div>October 27, 2014 at 9:07 pm #341784Hey!
They are showing up now, the quotes you put were wrong, i fixed it on your child functions.php.
Regards,
JosueOctober 27, 2014 at 9:15 pm #341792Great, thanks! Now they are just in the wrong position. I would like them to show up right underneath the heading of each article see the screenshot. How do I do that?
October 27, 2014 at 9:15 pm #341793- This reply was modified 10 years, 1 month ago by gentlemansgazette.
October 27, 2014 at 9:24 pm #341797Hey!
Unfortunately there is no hook available at that location, you’d need to directly edit the includes/loop-index.php theme file. I’ve already done that, the social links are now appearing at the desired location.
Alternatively you can copy single.php and includes/loop-index.php to your child theme installation so this modification gets preserved on theme update.
Best regards,
JosueOctober 27, 2014 at 10:20 pm #341820Will do, thank you so much!
October 27, 2014 at 10:33 pm #341827You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.