Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #938238

    Hi,

    In an earlier post I read about adding the whatsapp button to your share box.

    I implemented this code in my functions.php file:

    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" => "whatsapp://send?text=[title]&url=[permalink]", 'label' => __("Deel via Whatsapp",'avia_framework'));
    	return $args;
    }

    but now if I click the whatsapp share button on my mobile it opens up the whatsapp core website.

    I read about adding this to your link:
    data-action="share/whatsapp/share"

    How can I add this function to my link so it will work nicely?

    #938674

    Hey (Email address hidden if logged out) ,
    It looks like your code above for the link is not right, I believe this might be what you need to use:

    //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;
    }

    Best regards,
    Mike

    #938755

    Hi Mike,

    That code also doesn’t work.
    This links to the website from whatsapp.
    It needs to open the whatsapp application.

    #939593

    Hi (Email address hidden if logged out) ,

    To be able to add the data attribute you will need to modify the /enfold/includes/helper-social-media.php file.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #939803

    Is there an option to modify this in my child theme?
    And how can I do that?

    #940225

    Hi (Email address hidden if logged out) ,

    You need to copy the file to your child theme and preserve the folder structure, and make your changes there.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #940594

    Okay I know. But what is the thing I need to modify?
    What code do I need to insert in it?

    #941433

    Hi (Email address hidden if logged out) ,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #1104192

    I love this theme, but let me send u a constructive feedback.
    It is a little absurd that you keep for example google + and do not include whatsapp as a default option in the share buttons. It would be a good idea to include it by default, I am sure that many of your users would thank you

    #1104321

    Hi,
    Thank you for the feedback, I will let the dev team know, since G+ is shutting down and I will recommend whatsapp for them to review.

    Best regards,
    Mike

    #1104340

    You are doing a great job. Thanks for your effort

    #1104615

    Hi,
    Glad to try to help, thank you for using Enfold.

    Best regards,
    Mike

    #1110260

    Hi OlonamZaid, Jarmo and Enfold Team
    If you want to share a post or page on Whatsapp you have to change the line
    $args['Whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]");
    into
    $args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://api.whatsapp.com/send?text=[permalink]", 'label' => __("Share on Whatsapp",'avia_framework'));
    otherwise like you reported the link will open up the whatsapp core website.
    It works for me. Tested on several devices, but I’m only a graphic designer not a programmer. Hope this will help.
    Best Regards

    Here the code I use (functions.php in child theme)

    // Register new icon as a theme icon
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'rockets', 'icon' => 'uf232');
    	return $icons;
    }
    
    //Adjust icons
    add_filter('avia_filter_social_icons', 'avia_filter_social_icons_mod', 10, 1);
    function avia_filter_social_icons_mod($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    
    //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://api.whatsapp.com/send?text=[permalink]", 'label' => __("Share on Whatsapp",'avia_framework'));
    	return $args;
    }

    Pay attention to put the right icon with the font-family you are using: array( ‘font’ =>’font-family‘, ‘icon’ => ‘the one you choose‘);

    • This reply was modified 5 years, 6 months ago by manurimini.
    #1110310

    Hi manurimini.
    Thanks a lot! i will prove!

    #1110540

    Hi
    There was a little mistake in the code that prevented to share on Whatsapp when you were opening the post from Facebook.
    I’ve changed:
    => “https://api.whatsapp.com/send?text=url=%5Bpermalink%5D”,
    into
    => “https://api.whatsapp.com/send?text=%5Bpermalink%5D”,
    but you can also use
    => “https://api.whatsapp.com/send?text=I want to share this post with you or any other text [permalink]”,

    Sorry guys

    Add this code in Quick CSS

    #top #wrap_all .av-social-link-whatsapp:hover a {
        color: #fff;
        background-color: #25D366;
    }
    
    • This reply was modified 5 years, 6 months ago by manurimini.
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.