Tagged: whatsapp
-
AuthorPosts
-
September 22, 2015 at 11:17 am #506911
Hello,
I’m trying to add a whatsapp icon to my website following steps in
https://kriesi.at/support/topic/insert-code-above-in-social-links/I’ve already imported the fontello.zip files and made changes on functions.php
It doesn’t seem to work. Could you pls have a look ? I’m providing you with acces info on private content section.
Thank you!
XFSeptember 22, 2015 at 4:18 pm #507171Hi xfdigital!
I checked your functions.php file but didn’t see the code anywhere so I tried adding it in but it appeared you had it set around line 535 as there is now a duplicate function name error. Upload a fresh copy of the functions.php file and add the code in at the bottom of the file and let us know when your done.
Best regards,
ElliottSeptember 22, 2015 at 4:46 pm #507202Elliott,
Thank you. Done, uploaded fresh functions.php and added code at the bottom.
Rgds,XF
September 22, 2015 at 5:08 pm #507231Hey!
Glad to know Elliot could help :)
Please let us know if you ever need any help in the future.
Best regards,
DakeSeptember 26, 2015 at 3:47 am #509341Hi!
Try installing this plugin and pasting the code in Plugins > Edit Functions instead.
Cheers!
JosueNovember 7, 2015 at 11:39 am #531837Same problem here, imported the zip file and added the code at the bottom of the functions.php. No Whatsapp in the pull down menu in Enfold, Social links. And i would like to have Whatsapp listed at Enfold – Blog Layout – Social Media share buttons. Is this possible?
November 7, 2015 at 9:00 pm #531930November 8, 2015 at 11:04 am #532012Hi 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; }
November 9, 2015 at 12:56 pm #532522Hi!
The URL scheme for sharing should be something like this:
whatsapp://send?text=[title]-[permalink]
Regarding the social profiles at the socket, i’m not sure if there’s a scheme to link that, perhaps you could link it as a number?
tel:+44-20-8123-4567
Best regards,
JosueNovember 9, 2015 at 8:57 pm #532879Hi Josue! Thanks!!! I have Whatsapp in the social share section and it works! It would be nice for the theme to have Whatsapp in the social share section in a future update i guess.
The Whatsapp hover button bg i managed with#top #wrap_all .av-social-link-Whatsapp:hover a { color: #fff; background-color: #3bb528; }
Can you help me out with question 3, and 5 please?
November 9, 2015 at 11:09 pm #532949Hey!
Change the
//Add items on the social share section
code to:add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments($args) { $new_array = array( 'whatsapp' => array( "encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?text=[title]-[permalink]" ) ); return array_merge($new_array, $args); }
Regards,
JosueNovember 9, 2015 at 11:46 pm #532968Yes this is awesome!! Thanks Josue :D
You should add this to the How-To list.November 9, 2015 at 11:46 pm #532969Add Whatsapp to the social share section:
1. Upload this zip file in Enfold > Import/Export > Icon Font Manager.
2. If you have a child theme functions.php add this at the bottom:// 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) { $new_array = array( 'whatsapp' => array( "encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?text=[title]-[permalink]" ) ); return array_merge($new_array, $args); }
3. If you don’t have a child theme functions.php, install this plugin
and add the code from step 2 into the functions.php added by the plugin.
4. Add this to your Quick CSS to change the whatsapp-button color./* Whatsapp button color */ #top #wrap_all .av-social-link-whatsapp:hover a { color: #fff; background-color: #3bb528; }
November 10, 2015 at 12:53 am #532986Glad to help and thanks for sharing the process :)
Regards,
JosueDecember 15, 2015 at 8:38 pm #553254Hello from Madrid. I have installed wordpress multisite 4.4.
I’ve tried to follow the steps of reply #532969 (installing functionality plugin).
Seems that it should work well, but I can’t make the whatsapp option appears in “Social Profiles”.
I don’t know what I’m doing wrong. Any help?
December 16, 2015 at 12:41 am #553350Hola Marcos,
Sucede que cuando estas una instalación multi-sitio el plugin Functionality no te va a funcionar correctamente, lo que te recomiendo en este caso es que crees un theme hijo (child theme) para tu sitio, y en el functions.php de esté pegues los codigos.
Saludos,
JosueDecember 16, 2015 at 1:16 pm #553628Hello Josue.
I followed the instructions. It seems that it works in my “Primary site”, but not where I want (in a subfolder, when I have the site I’m building).
My functions.php created in enfold-child:
<?php
function theme_enqueue_styles() {$parent_style = ‘parent-style’;
wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array( $parent_style )
);
}
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );// 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)
{
$new_array = array(
‘whatsapp’ => array(
“encode”=>true, “encode_urls”=>false, “pattern” => “whatsapp://send?text=[title]-[permalink]”
)
);return array_merge($new_array, $args);
}
?>This returns a “500” error.
Maybe a multisite issue?
December 16, 2015 at 9:57 pm #554010Hi,
Can you please create us a temporary FTP / SFTP account? post it here as a private reply.
Regards,
JosueDecember 17, 2015 at 1:08 pm #554342Of course. Here we go…
December 17, 2015 at 1:13 pm #554346Hey!
It’s not working for me but try using the following code only:
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);
If you still get a 500 error enable WP_DEBUG and check for error messages:
https://codex.wordpress.org/WP_DEBUGBest regards,
JosueDecember 17, 2015 at 2:53 pm #554408Probably wasn’t working for you because I was logged at the same time. You have full access now.
Anyway, I give up. Too much for me. I can’t even see any debug.log created.
Such an important thing as the whatsapp link (nowadays), and so difficult and “hidden”… I can’t understand it.
I think you should describe a step-by-step how-to do this.
- This reply was modified 8 years, 10 months ago by marcosgil.
December 18, 2015 at 4:06 pm #555037I can see where the issue is, try putting the code again:
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); 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);
Make sure to copy it from the forum reply and not from the notification e-mail.
Best regards,
JosueDecember 21, 2015 at 12:54 pm #555871Thank you Josue. I appreciate your help. Especially when it seems a wordpress problem and not a enfold’s.
However, it doesn’t work.That code returns a 500 error.
If I put that code as a comment (between /* */), the child theme works fine, and that avoids the 500 error, but -of course- I cannot install the whatsapp icon.
December 22, 2015 at 1:24 am #556244Hi,
Try replacing your functions.php file with this:
https://www.dropbox.com/s/aafdigwmkceydhg/functions.php?dl=0Regards,
JosueDecember 22, 2015 at 11:42 am #556446Done. But if I add at the bottom the…
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );}
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);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);… it doesn’t work (500 error).
- This reply was modified 8 years, 10 months ago by marcosgil.
December 22, 2015 at 6:24 pm #556659Sorry my bad, i linked the wrong file, try with this:
https://www.dropbox.com/s/aafdigwmkceydhg/functions.php?dl=0December 22, 2015 at 10:57 pm #556780Ok Josue, thanks for your patience! It works finally.
Still remained the last step: the link that makes the icon work.
In the Social Icon URL: whatsapp://send?text=www.yourdomain.com.
I think there is a way to link exactly the page where you are (and not always the main “www.yourdomain.com”), but anyway… I’m happy enough :)
Thank you again, best regards
-
AuthorPosts
- The topic ‘ADD WHATSAPP ICON’ is closed to new replies.