co-authors plugin - inline listing
I'm trying to set up co-authors plugin in order to show articles authors
function inl_users() {
if ( function_exists( 'get_coauthors' ) ) {
$coauthors = get_coauthors();
//array_shift($coauthors);
foreach ( $coauthors as $coauthor ) {
$autArray[] = 'a href=' . get_author_posts_url( $coauthor-ID ) . '' . $coauthor-display_name . '/a';
echo implode(, , $autArray);
}
}
The first author is shown twice in the first element, like this:
for $autArray = (John Smith, Joe Blogs);
it returns John SmithJohn Smith, Joe Blogs
full rendered html is like this:
a href=https://example.com/author/john-smith/John Smith/aa href=https://example.com/author/john-smith/John Smith/a, a href=https://example.com/author/joe-blogs/Joe Blogs/a
as you can see I've tried to use array_shift() because I thought they were two distinct elements, but they are not
any suggestions?
thanks in advance
Topic multi-author list-authors author widgets plugins Wordpress
Category Web