From 1aeae329c65d44eba05e43f525f6f192faf300e6 Mon Sep 17 00:00:00 2001 From: Roy Date: Fri, 23 Dec 2016 12:03:56 -0500 Subject: [PATCH] Adding support for multiple authors --- inc/template-tags.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index f11c464..6384aef 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -75,17 +75,27 @@ function cs_posted_on() { esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); - - printf( __( 'Posted on %1$s by %2$s', 'cs' ), - sprintf( '%2$s', - esc_url( get_permalink() ), - $time_string - ), - sprintf( '%2$s', - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - esc_html( get_the_author() ) - ) - ); + + if ( function_exists( 'coauthors_posts_links' ) ) : + printf( __( 'Posted on %1$s by %2$s', 'cs' ), + sprintf( '%2$s', + esc_url( get_permalink() ), + $time_string + ), + coauthors_posts_links( null, null, null, null, false ) + ); + else: + printf( __( 'Posted on %1$s by %2$s', 'cs' ), + sprintf( '%2$s', + esc_url( get_permalink() ), + $time_string + ), + sprintf( '%2$s', + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + esc_html( get_the_author() ) + ) + ); + endif; } endif;