Tagged: 

Viewing 27 posts - 1 through 27 (of 27 total)
  • Author
    Posts
  • #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!
    XF

    #507171

    Hi 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,
    Elliott

    #507202

    Elliott,

    Thank you. Done, uploaded fresh functions.php and added code at the bottom.
    Rgds,

    XF

    #507231

    Hey!

    Glad to know Elliot could help :)

    Please let us know if you ever need any help in the future.

    Best regards,
    Dake

    #509341

    Hi!

    Try installing this plugin and pasting the code in Plugins > Edit Functions instead.

    Cheers!
    Josue

    #531837

    Same 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?

    #531930

    Hi!

    Did you try with the plugin?

    Cheers!
    Josue

    #532012

    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;
    }
    #532522

    Hi!

    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,
    Josue

    #532879

    Hi 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?

    #532949

    Hey!

    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,
    Josue

    #532968

    Yes this is awesome!! Thanks Josue :D
    You should add this to the How-To list.

    #532969

    Add 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;
    }
    #532986

    Glad to help and thanks for sharing the process :)

    Regards,
    Josue

    #553254

    Hello 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?

    #553350

    Hola 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,
    Josue

    #553628

    Hello 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?

    #554010

    Hi,

    Can you please create us a temporary FTP / SFTP account? post it here as a private reply.

    Regards,
    Josue

    #554342

    Of course. Here we go…

    #554346

    Hey!

    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_DEBUG

    Best regards,
    Josue

    #554408

    Probably 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.
    #555037

    I 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,
    Josue

    #555871

    Thank 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.

    #556244

    Hi,

    Try replacing your functions.php file with this:
    https://www.dropbox.com/s/aafdigwmkceydhg/functions.php?dl=0

    Regards,
    Josue

    #556446

    Done. 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.
    #556659

    Sorry my bad, i linked the wrong file, try with this:
    https://www.dropbox.com/s/aafdigwmkceydhg/functions.php?dl=0

    #556780

    Ok 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

Viewing 27 posts - 1 through 27 (of 27 total)
  • The topic ‘ADD WHATSAPP ICON’ is closed to new replies.