I'm trying to list authors for a certain category on Wordpress and I'm having trouble inserting a comma between each item, except for the last. Here's my code:
<?php
if (is_category() || is_tag()) {
$at_least = 1;
$author_array = list_author_in_this_cat ($at_least);
foreach (array_slice($author_array, 0, 10) as $author):
$name = get_userdata($author)->display_name;
$link = get_userdata($author)->user_login;
echo "<a href='/author/".$link."'>".$name."";
endforeach;
}
?>