Tagged: share links, social sharing
-
AuthorPosts
-
October 8, 2015 at 12:51 pm #515729
Hi,
I’m using a child theme for Enfold, so not sure how this might have happened, but the social links that appear under posts and portfolio items have moved from their position at the bottom of the entry to the top.
Please see attached links.
thanks!
Simon
October 9, 2015 at 7:41 am #516192Hi Simon!
Thank you for using Enfold.
Did you use the advance layout builder to add the social section? Or did you add it in a template file? If you check the html markup, it is currently rendered at the very top of the content. Please post the login details here so that we can check the site.
Regards,
IsmaelOctober 9, 2015 at 7:48 am #516194Hi Ismael,
There are only custom additions in the child theme’s functions.php file.
thanks,
Simon
:-
//Sharing buttons
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;
}
function modify_share_title(){
return “Tell your friends”;
}
add_filter(‘avia_social_share_title’, ‘modify_share_title’);add_theme_support(‘avia_template_builder_custom_css’);
?>October 9, 2015 at 1:22 pm #516411Hey!
Instead of using code, you can use Social Share Buttons element under Content elements to add social sharing to your content
Cheers!
YigitOctober 13, 2015 at 1:08 pm #518042The new alb element for social sharing is really fine, but what if you want to add social sharing to a large number of portfolio items you’ve already made ?
In that case, the code given here to put in functions.php is very useful : https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/
So, i would love using it on a site, but i can’t find the css to push the social bar at the bottom of the portfolio items.http://venise-alacarte.fr/portfolio-item/arte-couple-4-personnes/
Could you help me please ?
October 14, 2015 at 12:16 pm #518603Hey!
try this code:
.av-share-box { position: relative; top: 835px; }
Cheers!
AndyOctober 14, 2015 at 1:24 pm #518632Thanks Andy, but it does not seem to work. My question was : how to put the sharebox after the alb content , regardless of this content’s height (i.e. for all portfolio items).
October 20, 2015 at 8:17 am #521430Hi!
Please remove the previous modifications then replace the code on functions.php with this:
//social filter in the template builder 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('portfolio')) { ob_start(); avia_social_share_links(array(), false); $social = ob_get_clean(); $content = $content . $social; } return $content; }
Regards,
IsmaelOctober 20, 2015 at 11:28 am #521501Thanks for your help Ismael.
That filter must replace all the old code in function.php of the child theme, i’ve got it right ?Doing that, i’ve got that php error :
” Parse error: syntax error, unexpected T_FUNCTION, expecting T_STRING or T_VARIABLE or ‘$’ in /homepages/15/d311963126/htdocs/New/wp-content/themes/enfold-venisealc/functions.php on line 31 ”Any idea why ? Thanks.
October 21, 2015 at 4:16 am #522119Hi,
That means you have an error in your code, could you send us an admin login so that we can have a closer look? You can post the details in the Private Content section of your reply.
Regards,
RikardOctober 22, 2015 at 2:15 pm #522959Ok, i tried again and it seems ok. I’ve probably done something wrond adding the php in functions.php.
Is it possible to do the same thing with pages ?
Thanks for your kind help.
October 22, 2015 at 3:11 pm #523022Hey!
try this code for pages:
//social filter in the template builder 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()) { ob_start(); avia_social_share_links(array(), false); $social = ob_get_clean(); $content = $content . $social; } return $content; }
Best regards,
AndyOctober 22, 2015 at 3:25 pm #523034Thanks Andy.
Close Thread for me.October 22, 2015 at 3:53 pm #523058glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Cheers!
Andy -
AuthorPosts
- The topic ‘Social links position moved after update’ is closed to new replies.