run shortcode in excerpt of single custom post type
Hi because of the way my theme is set up, I need to run a shortcode inside the excerpt of a custom post type (services). This is the code I have so far...
function do_my_shortcode_in_excerpt($excerpt) {
if ( 'services' == get_post_type() ) {
return do_shortcode(wp_trim_words(get_the_content(), 55));
}
}
add_filter('get_the_excerpt', 'do_my_shortcode_in_excerpt');
This works fine (I'll need to increase the 55) but it stops the excerpts appearing everywhere else. I only want this filter to run on excerpts associated with services - leaving other excerpts unaffected. Can anyone assist me?