Home Forums Themes Support Claue add WhatsApp share

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #24104

      Hello

      is there a way to add WhatsApp share icon to the share icons?  I really need this.

      I saw that in a lot of other themes.

    • #24109

      Hi,

      Please add below code to claue-child > functions.php

      if ( ! function_exists( 'jas_claue_social_share' ) ) {
      	function jas_claue_social_share() {
      		global $post;
      		$src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), false, '' );
      		?>
      			<div class="social-share">
      				<div class="jas-social">
      					<a title="<?php echo esc_html__( 'Share this post on Facebook', 'claue' ); ?>" class="cb facebook" href="http://www.facebook.com/sharer.php?u=<?php esc_url( the_permalink() ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=380,width=660');return false;">
      						<i class="fa fa-facebook"></i>
      					</a>
      					<a title="<?php echo esc_html__( 'Share this post on Twitter', 'claue' ); ?>" class="cb twitter" href="https://twitter.com/share?url=<?php esc_url( the_permalink() ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=380,width=660');return false;">
      						<i class="fa fa-twitter"></i>
      					</a>
      					<a title="<?php echo esc_html__( 'Share this post on Google Plus', 'claue' ); ?>" class="cb google-plus" href="https://plus.google.com/share?url=<?php esc_url( the_permalink() ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=380,width=660');return false;">
      						<i class="fa fa-google-plus"></i>
      					</a>
      					<a title="<?php echo esc_html__( 'Share this post on Pinterest', 'claue' ); ?>" class="cb pinterest" href="//pinterest.com/pin/create/button/?url=<?php esc_url( the_permalink() ); ?>&media=<?php echo esc_url( $src[0] ); ?>&description=<?php the_title(); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
      						<i class="fa fa-pinterest"></i>
      					</a>
      					<a title="<?php echo esc_html__( 'Share this post on Tumbr', 'claue' ); ?>" class="cb tumblr" data-content="<?php echo esc_url( $src[0] ); ?>" href="//tumblr.com/widgets/share/tool?canonicalUrl=<?php esc_url( the_permalink() ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=540');return false;">
      						<i class="fa fa-tumblr"></i>
      					</a>
      					<a href="https://api.whatsapp.com/send?phone=whatsappphonenumber&text=<?php esc_url( the_permalink() ); ?>"><i class="fa fa-whatsapp"></i></a>
      				</div>
      			</div>
      		<?php
      	}
      }

      And change “whatsappphonenumber” with your phone number, please refer this article https://faq.whatsapp.com/en/general/26000030 to use phone number.

      Kind regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #24110

      Hi

      thanks for your answer, but I’m talking about share not about chat. I need that people can share link by pushing a button/icon and then it will open there WhatsApp and they can choos a freind to share the link with them

    • #24111

      Hi,

      Could you try when click it will send the link to phone number on your contact list

      Kind regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 3 reply threads

You must be logged in to reply to this topic.