Comma separated tax terms, with “and” before last item [duplicate]
This is how your code should look like I added some comments so you will understand its simple programming not really wordpress related. $locations = get_the_terms($post->ID, ‘location’); $locations = array_values($locations); $total_locations = count($locations); // the total start from 1 for($i = 0; $i < $total_locations; $i++) { echo $locations[$i]; // echo the location if($i < … Read more