Tagged: pages, products, social buttons, woocommerce
-
AuthorPosts
-
August 25, 2014 at 12:27 am #308509
Hi guys, really loving the theme and learning to tweak things as needed. What I’d like to do is to add the integrated social buttons on Woocommerce product pages. I’ve already figured out how to do this on regular pages and portfolio pages in addition to posts using this:
https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/
However, the code for this won’t work on Woocommerce product pages because it refers to inserting the social buttons after the Avia builder code that isn’t enabled on on Woocommerce product pages. Can you please let me know how I might go about doing this? Or alternatively how to turn the social buttons into a shortcode that could be embedded into each product page.
Thanks very much in advance! : )
August 25, 2014 at 2:26 am #308519Hey!
Try with this:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { if($context == "page" || $context == "single-portfolio" || $context == "product") avia_social_share_links(); }
Cheers!
JosueAugust 25, 2014 at 5:55 am #308602Thanks for your response, but unfortunately that code doesn’t work. I also just updated to the latest version of enfold to see if that might be the issue, however the code still doesn’t work. To be clear, it does work on pages and portfolio items, but not for products. Any other suggestions?
I forgot to mention that I’m using a child theme, so the code is partially successful when put in the child theme’s functions.php.August 25, 2014 at 6:32 am #308624This reply has been marked as private.August 25, 2014 at 6:52 am #308639Hi!
Try with this code instead:
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; }
Cheers!
JosueAugust 26, 2014 at 8:41 pm #309515Thank you Josue, that worked beautifully. All I had to change was the function name used in my previous code (used to make the social buttons appear on pages and portfolio items) so there wasn’t a clash/error due to the repeat use of the function name. Looks great now!
Thanks again,
Crys :)August 26, 2014 at 8:50 pm #309523You are welcome Crys, glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Social buttons on woocommerce product pages’ is closed to new replies.