Tagged: blog posts, social icons, social sharing
-
AuthorPosts
-
September 1, 2014 at 6:41 pm #311973
Hello!
I have initially edited my posts without ALB and was able to select a few social sharing icons for display at the end of the posts via an option available under Enfold – Blog styling.
Now that I am using ALB that option does not work anymore and I am not sure what code to add and where in order to achieve the following:I would like to have at the bottom of all my posts in the blog the following icons in the following order (with the corresponding links for sharing/printing/emailing):
– Print icon (with a link to the printer-friendly page)
– E-mail icon (with a window opening allowing the reader to send the post via e-mail)
– LinkedIn icon (with a window opening allowing the reader to share the post on his/her LinkedIn account)
– Twitter icon (same idea)
– Google+ icon (same idea), and
– Facebook icon (same idea).Thank you very much for your help.
Best,
CeraselaSeptember 1, 2014 at 6:42 pm #311974This reply has been marked as private.September 2, 2014 at 9:09 am #312120Hey!
Thank you for using Enfold.
Note that we don’t usually provide support for those who want to use the ALB for posts because of issues such as this one. If you want the share section entry below the post content, you can use this:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_single()) { $content .= '<div class="container">'; $content .= avia_social_share_links(array(), false); $content .= '</div>'; $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; } return $content; }
Cheers!
IsmaelSeptember 2, 2014 at 11:33 am #312197Hey Ismael,
I understand and really appreciate your help. Can you please let me know where to add this code?
Thank you,
Best,
Cerasela
September 2, 2014 at 11:39 am #312200Hey!
Please go to Appearance > Editor and add the code to functions.php file
Regards,
YigitSeptember 2, 2014 at 2:24 pm #312312Hey Yigit,
It worked, thank you!
Just a minor tweak: would it be possible to have this section compacted and aligned to the left so that it does not go through the sidebar?
(currently it stretches on all the page including the sidebar: http://enter-law.com/rca/)Also this code appears before the share section of each post for some reason:
[/av_four_fifth]
How can I remove it?
Thank you and regards,
Cerasela
September 3, 2014 at 4:43 pm #312991Hi!
1) The [/av_four_fifth] code must be part of your (customized) code. If you’re not sure which function or template outputs this code please upload an unmodified version of the theme and customize the code step by step to find the culprit.
2) You could add a style attribute to the container like:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_single()) { $content .= '<div class="container" style="max-width: 500px;">'; $content .= avia_social_share_links(array(), false); $content .= '</div>'; $content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>'; } return $content; }
You can replace 500px with any other positive px value if you want to change the width of the social icons box.
Cheers!
PeterSeptember 3, 2014 at 10:54 pm #313119Thank you Peter,
For 2) I have tried with 400px and it looks better but it is still kind of in the middle of the page, I have even tried with my limited knowledge to add align:left; at the end of this line
$content .= ‘<div style=”height:1px; margin-top:50px;” class=”hr”></div>’;
but it wasn’t taken into account.Would you be kind enough to give me an equivalent for align:left that would work with this code you provided so that the whole section (including “Share this entry”) is aligned with the rest of the post?
(Regarding point 1) I think it appears because of an incompatibility between this code for the share section and the ALB, I have noticed that usually ALB gave this type of errors when it was not confortable with the section before or after the error code, but as I can’t even imagine to alter/adapt this code myself I will wait until someone more experienced will be able to give me a hand. I understand if you can’t look into it further at this stage.)
Thanks again and have a nice day/evening,
Best,Cerasela
-
AuthorPosts
- The topic ‘Social sharing and printer friendly icons at the end of posts using ALB’ is closed to new replies.