Hi Josue, thanks, the button now appears in my socket. But it doesn’t work.
1. What url should i use? (Enfold, Social links, Social Media Icon -> URL)
I managed to add a Whatsapp button to the social media share buttons on my blog post items but it doesn’t work.
2. What is the Whatsapp url for this share button?
3. How can i get this button as the first share button instead of the last one?
4. how can i change the bg color of this button?
5. How can i get the right Whatsapp icon? (In the socket i get the correct Whatsapp icon from your zip file but in the social media share button its the wrong one.)
Example page is in the private section.
Here is the code i’m using:
// Register new icon as a theme icon
function avia_add_custom_icon($icons) {
$icons['whatsapp'] = array( 'font' =>'whatsapp-font-icon', 'icon' => 'ue800');
return $icons;
}
add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
// Add new icon as an option for social icons
function avia_add_custom_social_icon($icons) {
$icons['Whatsapp'] = 'whatsapp';
return $icons;
}
add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
//Add items on the social share section
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['Whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]");
return $args;
}
Done, here’s the code i ended up using:
add_filter('avf_default_icons','avia_replace_close_icon', 10, 1);
function avia_replace_close_icon($icons)
{
$icons['xing'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue923');
return $icons;
}
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['xing'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.xing.com/social_plugins/share/new?h=1&url=[permalink]&t=[title]");
return $args;
}
Sure:
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[permalink]&via=USERNAME");
return $args;
}
Change “USERNAME”.
Hey!
That’s the post shortlink and it is used instead of the permalink because of twitter character limit, you can change this with the following filter in your theme / child theme functions.php:
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[permalink]");
return $args;
}
You can add the @via thing there too.
Regards,
Josue
Hi team,
how can I add Xing to the social share buttons (avia builder and on blog posts)? There is a Xing button for social profiles – so why is there still no default for the social sharing? It’s very important in Germany and Austria!
I found this code in the forum but it doesn’t work:
/**
* Add items on the social share section
*/
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['xing'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.xing.com/social_plugins/share/new?h=1&url=[permalink]&t=[title]");
return $args;
}
Please advise,
Jan :)
Hi! Josue
about Q1:
i use http://kriesi.at/documentation/enfold/custom-social-icons/
code is(add 3 share link):
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['wechat'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.wechat.com/sharer.php?u=[permalink]&t=[title]");
$args['weibo'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.weibo.com/sharer.php?u=[permalink]&t=[title]");
$args['QQ'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.qq.com/sharer.php?u=[permalink]&t=[title]");
return $args;
}
but no have corresponding icon, how to add icons and the icons matched to the corresponding field;
At this point I have imported into the site icon in the icon library;
Best regards
Hey Giles!
Thank you for using Enfold.
Add this in the functions.php file to change the label:
add_filter('avia_social_share_link_arguments', 'avia_change_social_link_args', 10, 1);
function avia_change_social_link_args($args)
{
$args['mail']['label'] = __("Share by Email",'avia_framework');
return $args;
}
Best regards,
Ismael
add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
function avia_add_social_share_link_arguments($args) {
$args[‘xing’] = array(“encode”=>true, “encode_urls”=>false, “pattern” => “https://www.xing.com/social_plugins/share/new?h=1&url=[permalink]&t=[title]”);
return $args;
}
Hi!
Can you paste the avia_social_share_link_arguments filter code you are using so i can test it on my install?
Best regards,
Josue
Hello,
I had to add a new social share icon for a client using the avia_social_share_link_arguments filter. The customer wants to have this new share icon in front of all the others. Therefore I changed the merge order in helper-social-media.php from
$this->args = array_merge($default_arguments, apply_filters( ‘avia_social_share_link_arguments’, $args));
to
$this->args = array_merge( apply_filters( ‘avia_social_share_link_arguments’, $args), $default_arguments);
This works perfect as long as I do it in the parent theme. But if I put the helper-social-media.php file into the child it does not work. However the child is working well and some customizations in helper-main-menu.php show up just fine.
It looks like for any reason helper-social-media.php wont be read from a child. Any idea why?
PS.:
I just renamed the file in the parent with helper-social-media.php present in the child theme and got:
Fatal error: require_once() [function.require]: Failed opening required ‘includes/helper-social-media.php’ (include_path=’.:/usr/lib/php5′) in /var/www/wp-content/themes/enfold/functions.php on line 390
If i do the same with the file helper-main-menu.php i get nor error as long as the file is present in the child theme. Sounds to me like an evidence that helper-social-media.php is ignored in childthemes.
Hi Ismael,
thank you very much, great support!
There was a error in the xing sharing url i think. It works for me with this url:
/**
* Add items on the social share section
*/
add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args[‘xing’] = array(“encode”=>true, “encode_urls”=>false, “pattern” => “https://www.xing.com/social_plugins/share/new?h=1&url=[permalink]&t=[title]”);
return $args;
}
-
This reply was modified 11 years, 1 month ago by
dondela.
Hey dondela!
Thank you for using Enfold.
Add this on functions.php:
/**
* Add items on the social share section
*/
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$args['xing'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.xing.com/sharer.php?u=[permalink]&t=[title]");
return $args;
}
Change the pattern.
Cheers!
Ismael
Hey!
In fact there’s an easier way to change the url. Go to Appearance > Editor, click on “functions.php” to edit the file and then insert this code at the very bottom of the file:
add_filter('avia_social_share_link_arguments', 'avia_change_social_link_args', 10, 1);
function avia_change_social_link_args($args)
{
$args['linkedin']['pattern'] = "http://linkedin.com/shareArticle?mini=true&title=[title]&url=[permalink]";
return $args;
}
If you want to use ftp to edit the file connect to your ftp server (i.e. with Filezilla), navigate to wp-content/themes/enfold/ and download the functions.php file. Then edit the file and upload the modified file. Confirm the “overwrite file” dialog if necessary.
Regards,
Peter