Add new social share buttons (WhatsApp, Tumblr, Parler, Email)

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

  • enable “Social Sharing” in the “Display Settings” tab of the View
    Content Views Pro - social sharing
  • add this code to file functions.php of your active theme:
    // Content Views Pro - 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( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-whatsapp' ) );
    
    	### tumblr ###
    	$social_link	 = sprintf( 'http://www.tumblr.com/share/link?url=%s', $url );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-tumblr' ) );
    
    	### parler ###
    	$social_link	 = sprintf( 'https://parler.com/new-post?message=Check%20this%20out&url=%s', $url );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $social_link, esc_attr( 'pt-cv-social-parler' ) );
    
    	### email ###
    	$email_link	 = sprintf( 'mailto:?subject=%s&body=%s', 'Hello, check this post', str_replace( array( ' ', '+' ), '%20', $title ) . ": $url" );
    	$buttons_html[]	 = sprintf( '<a href="%s" class="%s" target="_blank"></a>', $email_link, esc_attr( 'pt-cv-social-email' ) );
    
    	return $buttons_html;
    }
    
  • add this code to Custom CSS field in Content Views >> Settings page:
    .pt-cv-social-whatsapp {
        background: url(https://i.imgur.com/hsCmozv.png) no-repeat !important;
        background-size: 32px !important;
    }
    
    .pt-cv-social-tumblr {
        background: url(https://i.imgur.com/xvNm4pF.png) no-repeat !important;
        background-size: 32px !important;
    }
    
    .pt-cv-social-email {
        background: url(https://i.imgur.com/7NC5NQP.png) no-repeat !important;
        background-size: 32px !important;
    }
    
    .pt-cv-social-parler {
        background: url(https://i.imgur.com/ajMOaUw.png) no-repeat !important;
        background-size: 32px !important;
    }
    

Notice:
If you are using another plugin to add social buttons to your site, you might integrate that plugin to grid/list View using the code here (see document).
The code for // Put the text, HTML or PHP code here is the PHP function (or shortcode) to shows social buttons for a post of the social plugin (you might contact their support to know that function).

Best regards,