Snippets: Enable Social Sharing For Testimonials

// Enable social share for testimonials
function my_enable_social_for_testimonials( $return ) {
    if ( is_singular( 'testimonials' ) ) {
        $return = true;
    }
    return $return;

}
add_filter( 'wpex_has_social_share', 'my_enable_social_for_testimonials' );


// Display social share for testimonials
function display_social_share_on_testimonials() {
    if ( is_singular( 'testimonials' ) ) {
       wpex_social_share(); 
    }
}
add_action( 'wpex_hook_content_bottom', 'display_social_share_on_testimonials' );

Snippet Type: PHP

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)