Separate array output into a
The foreach loop isn’t needed. This will list out all job categories separated by a comma. $terms = wp_get_post_terms( $job->ID, ‘job_listing_category’ ); echo implode( ‘, ‘, wp_list_pluck( $terms, ‘name’ ) ); // Marketing, Sales, Finance, Support