-
AuthorPosts
-
April 6, 2018 at 12:41 pm #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?
April 7, 2018 at 9:34 pm #938674Hey (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,
MikeApril 8, 2018 at 10:53 am #938755Hi Mike,
That code also doesn’t work.
This links to the website from whatsapp.
It needs to open the whatsapp application.April 10, 2018 at 6:26 am #939593Hi (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,
VictoriaApril 10, 2018 at 11:41 am #939803Is there an option to modify this in my child theme?
And how can I do that?April 11, 2018 at 7:10 am #940225Hi (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,
VictoriaApril 11, 2018 at 5:58 pm #940594Okay I know. But what is the thing I need to modify?
What code do I need to insert in it?April 13, 2018 at 12:01 pm #941433Hi (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,
VictoriaMay 25, 2019 at 6:34 pm #1104192I 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 youMay 26, 2019 at 6:26 pm #1104321Hi,
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,
MikeMay 26, 2019 at 8:03 pm #1104340You are doing a great job. Thanks for your effort
May 28, 2019 at 2:17 am #1104615June 14, 2019 at 10:20 am #1110260Hi 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 RegardsHere 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, 5 months ago by manurimini.
June 14, 2019 at 1:23 pm #1110310Hi manurimini.
Thanks a lot! i will prove!June 14, 2019 at 11:50 pm #1110540Hi
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, 5 months ago by manurimini.
-
AuthorPosts
- You must be logged in to reply to this topic.