Tagged: whatsapp
-
AuthorPosts
-
March 22, 2020 at 6:42 pm #1195279
Hello, I want to use this shortcode [ht-ctc-share] when i click to whatsapp image on function “share this article”, but buttom not work :-(
This is my code:
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments { $new_array = ( 'whatsapp' => array( echo do_shortcode('[ht-ctc-share]') ) ); return array_merge($new_array); }
- This topic was modified 4 years, 8 months ago by foscolino.
March 25, 2020 at 3:22 pm #1197695Hey Andrea,
The code is missing braces after the function name and where did you even get the code?
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments() { $new_array = ( 'whatsapp' => array( echo do_shortcode('[ht-ctc-share]') ) ); return array_merge($new_array); }
Please have a look here:
Best regards,
VictoriaMarch 25, 2020 at 7:35 pm #1197823Hi Victoria, i have already seen your post “Whatspp button in share box” but is not a valid solution because in firefox or chrome not work correctly, and should be installed whatsapp client on the pc.
I have used CLICK TO CHAT plugin and work very Very well by using shortcode [ht-ctc-share].
My idea was to insert shortcode to whatsapp image on function “share this article”, using shortcode [ht-ctc-share].
I have tried your function, but the page was broken :-(You can see my WEBSITE
There has been a critical error on your website.
Can you help me, please? whatsapp by this shortcode is a interesting solutions for all..- This reply was modified 4 years, 8 months ago by foscolino.
March 25, 2020 at 8:06 pm #1197844Hi foscolino,
It cannot be added like that. You need to add a custom widget area in the header, make the widget with the shortcode and assign in there.
Here are the docs for you:
Best regards,
VictoriaMarch 29, 2020 at 1:26 pm #1198809Hi Victoria, finally i have create a correct code to share un whatsapp.
This is the code// 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' =>'whatsapp-font-icon', 'icon' => 'ue800'); 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://web.whatsapp.com/send?text=[permalink]", 'label' => __("Condividi su Whatsapp",'avia_framework')); return $args; }
thanks
March 31, 2020 at 5:58 pm #1199387Hi foscolino,
Glad you got it working for you and thank you for sharing! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.