Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Great plugin, was exactly what I was looking for.

    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');
Viewing 2 replies - 1 through 2 (of 2 total)