Skip to content

Snippet: 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' );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top