Add new social share buttons (WhatsApp, Tumblr…)

Content Views Pro helps you to show social share buttons easily. By default, you can choose to show sharing buttons of Facebook, Twitter, Google +, Linkedin, Pinterest.
To add more social share buttons, please:

  • add this code to file functions.php of your active theme:
    // CVPro - Add new social buttons
    add_filter( 'pt_cv_social_links', 'cvp_theme_social_links', 100, 3 );
    function cvp_theme_social_links( $buttons_html, $url, $title ) {
    	$social_link	 = sprintf( 'SHARE_URL_FORMAT=%s', $url );
    	$buttons_html[]	 = sprintf( '', $social_link, esc_attr( 'pt-cv-social-NAME' ) );
    
    	return $buttons_html;
    }
    
  • add this code to Custom CSS field in Content Views >> Settings page:
    .pt-cv-social-NAME {background: url(YOUR_URL) no-repeat !important}
    
  • replace SHARE_URL_FORMAT, NAME, YOUR_URL in above code with your values.

For example, this code will add share buttons of whatsapp and tumblr:

// CVPro - Add new social buttons
add_filter( 'pt_cv_social_links', 'cvp_theme_social_links', 100, 3 );
function cvp_theme_social_links( $buttons_html, $url, $title ) {
	# whatsapp
	$social_link	 = sprintf( 'whatsapp://send?text=%s', $url );
	$buttons_html[]	 = sprintf( '', $social_link, esc_attr( 'pt-cv-social-whatsapp' ) );

	# tumblr
	$social_link	 = sprintf( 'http://www.tumblr.com/share/link?url=%s', $url );
	$buttons_html[]	 = sprintf( '', $social_link, esc_attr( 'pt-cv-social-tumblr' ) );

	return $buttons_html;
}

Best regards,