Conditional Argument for Multiple CPTs in WordPress
<?php
// Change Read More Text For Excerpts - change based on CPT
add_filter( 'excerpt_more', 'prefix_read_more_link' );
function prefix_read_more_link( $more ) {
if( in_array( get_post_type(), array('treatment', 'package')) ) { //add in CPTs
return '<a href="' . get_permalink() . '" class="more-link" title="See More">See More</a>'; //change read more text
}
else { //what all the other post types get
return '<a href="' . get_permalink() . '" class="more-link" title="Read More">Read More</a>';
}
}