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
- 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=%s&url=%s', 'Check%20this%20out', $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(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAZlBMVEVWuGFXumFXuWNWuWJXumP////t+O5fvmv6/vva8N2EzY11xn/P7NPM6s+/5cS6479rw3ZbvGfE58mz4Lma1qGr3bGQ0piJz5L0+vXw+fHj9OXV7tjH6Muj2qp7yYSp3K+f16aV1J0/49wtAAAABHRSTlP7+IB8OxNwCAAAANtJREFUOMvNk90SgiAQhak4C6SigD9ZavX+L5nUMNMg2kxXcrUDH+zZsws7HfjGYkcWn8cE4z/W/oDzvdTNeRV4Ei5K9aA6CRiLYfJBZlGIBDDINoSdzJdAjfZLCx4xYMhyXlJ4uryICOiQ8Qrh4hy2EeBoVge48PK1jAB787uoAlDkETB4YJK5WQMcfUpR2USNCCkikd5MCQnUCZGm1x/5jnATiTK5kyG98EaNCydV8WVkwuoK91HZt45Mp5o1ArIg9EpRut257nzuRs8DY/Y91X98TsaOmwQ7vQBKsRaFijPuWgAAAABJRU5ErkJggg==) no-repeat !important; } .pt-cv-social-tumblr { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAATlBMVEU5WXb///9adY7u8fPq7fC8x9FYc4v5+vva3+XJ0tpzip9HZYD4+frw8/Xe4+jS2eDN1d24w86frrySo7OPobKClql2jKBVcIlOa4U/XnoLzaiKAAAAXklEQVQ4y+XKNxKAMAxEUclBTuTM/S+KXVBKVIwL/2pn9kGTLT7IYEAj/hFFkHYnA3yzvwE68tkrRRcwqQx0GZVBJwHCXAQ4OXC7IrxB4AqIJR6Q/gCQVjtO8wbN9QDT4gH/kQUgiwAAAABJRU5ErkJggg==) no-repeat !important; } .pt-cv-social-email { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAllBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8oKCjExMTc3NzY2Nj8/PyYmJg8PDwrKyv4+PjV1dWmpqaFhYVqampiYmJXV1dFRUUvLy8FBQXx8fHt7e3b29vFxcWpqamSkpKJiYl2dnZnZ2cdHR0LCwv09PTi4uLg4ODHx8fDw8O4uLizs7Orq6uLi4t7e3tubm5NTU0lJSUn0fMjAAAABnRSTlP6+/iAfXyEjkPGAAAAs0lEQVQ4y93Sxw6CQBSF4VF0DsLQe6/2/v4vp8YQGSCwMjH+2/NtbnLJYk5HmgmE2/sRQif6KxCIvQIOaBd0KjQOyI6ro5XuOgYHJFhq9Nkj1YLcATArqdljLUUfYE937z0REwwBxNUJz1JfwjCAQs9AThVgGFiqodqlZ/j5IGCvS5ltM6xvJeuD0CvQxK5e2AVbX0GrTNvwwLwfwHWsTQ7UyqpTFvzcR30VzCZ2IpDRffkA0EEfRcjCR6IAAAAASUVORK5CYII=) no-repeat !important; } .pt-cv-social-parler { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAflBMVEW/Hi3///++GirAHy7FMj/BJTPruLvnq67RW2Tz1NXkn6TAIjHmqKzLSVT89PTjnKLeiZHz1tjpsLTlo6jilpzcgIfWbXbDKzjCJjT02Nvwy87vx8nsv8Hei5LTZG3QWmPPVF/ELjv67+/56uv34uT24uPy09TdiZHTZm/HO0c6oKDXAAAAtElEQVQ4y+XRWRaDIAwF0CQ4UEWt86y1c/e/waLl+EO6Au8vjxc4gYMRi2PUgriAq9LT5tmrqWECTY+7WDnMiEjOs9SmsUNUTAftHB9jSUwCxAbo02IClvCd+ysVkfDRC637VYw/FUGAg2sVZHjzAy3RDRnT4HqYCFMWPbAAJvAiIE1EA14vxATOBLIsy/yOmITABvTwVRws8CdQtGna5dJ8gRlRm23ygdEc8MKqsF5u7eLAvh4nCLfcRZZNAAAAAElFTkSuQmCC) no-repeat !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,