So you want to style a post depending on its author?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
/*
Plugin Name: Add Author Class
Plugin URI: http://cedmax.net
Description: extends post_class() to add author class
Version: 1
Author: cedmax
Author URI: http://cedmax.net
*/
function add_author_class($class) {
	array_push($class, 'author-'.get_the_author_meta('user_nicename'));
	return $class;
}
 
add_filter("post_class", "add_author_class" );
?>

you’re welcome