Tagged: Social toolbar
-
AuthorPosts
-
September 4, 2014 at 11:26 pm #313655
Hi,
I use the template builder on my posts and I want to add the social toolbar.
I tried using the code on https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/#post-260646It works but I don’t won’t the bar on my pages. I want it only on the posts.
September 6, 2014 at 2:12 am #314248Hey!
Try with this code:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { if($context == "post") 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,
JosueSeptember 8, 2014 at 1:54 pm #315041Hi,
Thanks for sending this.
It works on all my pages & posts.
However, I need it only on the posts; Is there any way I can make it not appear on my pages?Best regards,
Femi
September 8, 2014 at 7:12 pm #315296Hi Femi,
That should not be happening, can you please create me an administrator account? post it here as a private reply.
Regards,
JosueSeptember 9, 2014 at 8:56 am #315702This reply has been marked as private.September 9, 2014 at 6:38 pm #316042Hey Femi,
Try using this code instead:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2); function avia_add_social_toolbar($id = "", $context = "") { if($context == "post") 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 = "") { if(is_singular('post')){ $content .= avia_social_share_links(array(), false); $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; } return $content; }Best regards,
JosueSeptember 10, 2014 at 4:23 pm #316716Works great. Many thanks.
September 10, 2014 at 5:15 pm #316774You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Use the social toolbar with template builder posts’ is closed to new replies.
