Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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, 9 months ago by foscolino.
    #1197695

    Hey 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,
    Victoria

    #1197823

    Hi 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, 9 months ago by foscolino.
    #1197844

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

    #1198809

    Hi 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

    #1199387

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.