Tagged: devin-docs
-
AuthorPosts
-
May 4, 2014 at 11:25 am #259925
Hi EnSuTeam,
I love the out-of-the-box share function (share this entry).
But is there a way to have these share icons on portfolio items and pages ?If it’s not possible, i must use a plugin which seems to defeat the idea of a built-in function… ;)
Thanks for your help.
May 6, 2014 at 10:01 am #260646Hey ouranos3!
Yes, please try to use this code to insert the buttons at the bottom of portfolio pages/standard pages:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { if($context == "page" || $context == "single-portfolio") avia_social_share_links(); }
If you also want to use the social toolbar with template builder pages use this code instead:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { if($context == "page" || $context == "single-portfolio") avia_social_share_links(); } add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { $content .= avia_social_share_links(array(), false); $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; return $content; }
Best regards,
PeterMay 6, 2014 at 4:12 pm #260789Thanks Peter.
Code for ALB works fine. That’s perfect.
Code for Standard WP editor doesn’t work
I’m using a child theme functions.php for both.Here’s in an example with a page with standard WP editor :
http://586814b516.url-de-test.ws/enfoldsupport/aa_simple_page_without_alb/May 6, 2014 at 11:57 pm #261011Sorry to be pedantic here. Where do I add the code to enable social sharing on pages? I have tried functions.php but it’s not working :(
This is definetly one to add in the next update ;)
May 7, 2014 at 3:05 am #261049I added the code to functions.php of my child theme.
The second code block (which adds social share icons to pages and portfolio items made with the AVIA Editor) works fine.
But the first one, for standard pages, doesn’t work for me.May 7, 2014 at 9:37 am #261213Hey!
Please update to Enfold 2.7.1 – the ava_after_content hook is not available in 2.7 or previous theme versions.
Best regards,
PeterMay 7, 2014 at 11:41 am #261250Thanks for your accurate support Peter. Works fine.
Resolved. -
AuthorPosts
- The topic ‘Share icons on pages and portfolio items ?’ is closed to new replies.