-
AuthorPosts
-
October 30, 2014 at 10:32 am #343310
Hi!
I’m looking for solution to show the sharing buttons for each product page and on category pages. I have added code in the themes function.php to get sharing buttons on the common pages. I found some previously topics about this here on the forum, but when I paste that code into the file, I only get a fatal error message and have to uppload a clean functions.php file!
Help is preciated!
October 30, 2014 at 2:07 pm #343399Hi Effektid!
Add this code at the bottom of functions.php:
add_action('woocommerce_after_single_product_summary', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { avia_social_share_links(); }
And add this to the Quick CSS:
.single-product .av-share-box { margin-bottom: 20px; }
Regards,
ArvishOctober 30, 2014 at 3:29 pm #343440Thanks for your answer, but it’s not working! I get the same fatal error message and need to replace the functions.php file with a new copy. Any other ideas?
October 31, 2014 at 6:07 pm #344212Hi!
It does work fine on my local installation. Do you mind creating a temporary admin login and posting it here privately so we can add the code for you?
Best regards,
YigitNovember 3, 2014 at 10:27 am #345176This reply has been marked as private.November 4, 2014 at 5:18 am #345722Hi!
Thank you for the info but you forgot the website url. Please replace the code with this:
add_action('woocommerce_after_single_product_summary', 'avia_add_social_toolbar', 10); function avia_add_social_toolbar() { $content = avia_social_share_links(array(), false); $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; echo $content; }
Best regards,
IsmaelNovember 4, 2014 at 2:21 pm #345848This reply has been marked as private.November 5, 2014 at 12:54 pm #346468Hello! Anyone there!?
I found the error that caused the fatal error message when I added the code above to functions.php. I had already added a simliar code to get the sharing buttons in the bottom of the common pages. After I removed that code it worked, but now I don’t have any sharing buttons on the pages!
Is there a way to combine these to script?
November 6, 2014 at 9:20 am #347012Hey!
Could you forward us the link and credentials to your site so we can have a closer look.
Cheers!
ArvishNovember 6, 2014 at 12:22 pm #347055This reply has been marked as private.November 7, 2014 at 11:49 am #347673Hey!
You skipped our post above. Remove browser cache then check the single product page: **removed upon request**
Best regards,
Ismael- This reply was modified 10 years, 1 month ago by Yigit.
November 7, 2014 at 12:43 pm #347685This reply has been marked as private.November 8, 2014 at 2:38 am #348034Hi!
If you want to show the share link on pages, add this at the bottom of the previous code:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { $content .= '<div style="height:1px; margin-top:20px;" class="hr"></div>'; $content .= avia_social_share_links(array(), false); return $content; }
Regards,
IsmaelNovember 10, 2014 at 9:32 am #348680This reply has been marked as private.November 10, 2014 at 7:33 pm #348973November 11, 2014 at 9:09 am #349233Thanks! Yes, it’s resolved!
-
AuthorPosts
- The topic ‘Buttons to share Woo Commerce products?’ is closed to new replies.