Tagged: social sharing
-
AuthorPosts
-
September 11, 2014 at 3:06 pm #317420
Hello,
I can’t understand why the social share box is not available as a shortcode in the layout builder? I have read this post:
https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/#post-260646which advised how to add it in code but I only want the social box on pages that I need to add it to, not all pages – unless I am missing something?
Is there a way to add it to a page (not a post) as and when I need it? Social sharing is a basic component nowadays but Enfold seems
to be quite restrictive when it comes to this aspect of the design.Thanks
Andrew
September 12, 2014 at 3:31 am #317778Hey Andrew!
This could work, try adding this to functions.php:
function avia_sharelinks_func() { avia_social_share_links(); } add_shortcode('avia_sharelinks', 'avia_sharelinks_func');
Then wherever you want the share links to appear use [avia_sharelinks].
Cheers!
JosueSeptember 12, 2014 at 11:54 am #318022Thanks for getting back to me Josue, I will give it a go!
Thanks again,
Andrew
September 12, 2014 at 2:25 pm #318126Hi!
Please try and let us know so we can mark the thread as resolved or assist you further :)
Best regards,
YigitSeptember 13, 2014 at 12:12 pm #318480Hello,
Unfortunately this didn’t have any effect. I added the code to the bottom of the functions.php file and added the shortcode in a text box on a page but nothing appears on the page where the sharebox should be.
Thanks
Andrew
September 13, 2014 at 12:14 pm #318483My mistake, it does appear but not where it should. The page has a slider at the top and the share box text appears above it (under the title bar) but the actual share boxes are under the slider, I can only just slightly see the first couple of pixels of them. This happens no matter where I place the text box on the page.
Thanks
Andrew
September 13, 2014 at 3:06 pm #318531Hi!
Unfortunately, using the function as a shortcode will break the layout of the share section. You can add this on functions.php:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_page(2) || is_page(1167)) { $content .= avia_social_share_links(array(), false); $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; } return $content; }
Change the page id on the is_page function to control where you want to show the share section.
Regards,
IsmaelSeptember 13, 2014 at 4:20 pm #318544Hello and thanks for the reply.
Not really an option to use page id’s because this might need to apply to hundreds of pages as and when. Can I suggest that something as crucial as a social share option should really be part of the layout builder or shortcode generator in future, I was surprised that it is not already in there.
Thanks
Andrew
September 13, 2014 at 6:19 pm #318558September 13, 2014 at 10:01 pm #318635Will do,
Thanks again,
Andrew
-
AuthorPosts
- The topic ‘Social Share Box On Pages’ is closed to new replies.