Get post count for current custom taxonomy

You can use wp_get_post_terms( get_the_ID(), 'series' ) to obtain all terms associated with the current post. This function returns array of WP_Term objects and WP_Term has count property which can be used as condition.

error code: 523