Anyone? Thanks in advance!
Did you add the coauthor() tag to your template files? For example, you need to replace the the_author(); with coauthors();
I just recently ran into this problem, but didn’t want to find every occurance of the_author() in my theme. I put together a filter that hooks into the_author() in my themes functions.php file that did the trick… It could probably be cleaned up quite a bit, but hopefully it helps:
function use_coauthors() {
$authors = get_coauthors();
$numauthors = count($authors);
$result = '';
foreach($authors as $author){
$result .= $author->display_name;
if ($numauthors > 2) {
$result .= ', ';
} elseif ($numauthors == 2) {
$result .= ' and ';
} else {
$result .= '';
}
$numauthors--;
}
return $result;
}
if ( function_exists('get_coauthors') )
add_filter('the_author','use_coauthors');
pints1ze: that is awesome!
I didn’t know there was a filter for the_author! Would you mind if I add your code into the plugin? I’ll credit you of course 🙂
Hi! First off thanks for enhancing this plugin it sounds like I am needing however I am having troubles implementing the plugin with my K2 theme template. I have added the above code:
function use_coauthors() {
$authors = get_coauthors();
$numauthors = count($authors);
$result = ”;
foreach($authors as $author){
$result .= $author->display_name;
if ($numauthors > 2) {
$result .= ‘, ‘;
} elseif ($numauthors == 2) {
$result .= ‘ and ‘;
} else {
$result .= ”;
}
$numauthors–;
}
return $result;
}
if ( function_exists(‘get_coauthors’) )
add_filter(‘the_author’,’use_coauthors’);
and also replaced all my the_author with coauthors, yet it still does not seem to appear on my blog.
Any help would be greatly appreciated.
Thanks so much in advance!