Title: Post Author Highlight
Last modified: August 19, 2016

---

# Post Author Highlight

 *  Resolved [thisisedie](https://wordpress.org/support/users/thisisedie/)
 * (@thisisedie)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/post-author-highlight/)
 * What I’d like to do is makes the background on different author posts different
   colors. I can do this for author comments but can’t figure out how to do it for
   author posts. Anyone have any ideas? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/post-author-highlight/#post-1619756)
 * if your theme is using `post_class()` in the div that contains the post, you 
   can add an author class to it by adding this code to functions.php of your theme:
 *     ```
       //add an author class to post_class() by filter//
       function post_author_id_class($classes) {
       	    global $post;
       	    $classes[] = 'author-'.get_the_author_meta('user_nicename');
       	    return $classes;
       	}
       add_filter('post_class', 'post_author_id_class');
       ```
   
 * and then, for instance, style with:
    `.author-admin { background: #123456; }`
 * if your theme does not use `post_class()`, you might need to edit the template
   files where you want to show this different background (index.php, single.php,..)
   and find the div that surrounds the posts;
 * simple example:
    `<div class="post" id="post-<?php the_ID(); ?>">`
 * to include an author class, you could change it to:
    `<div class="post<?php echo'
   author-' . get_the_author_meta('user_nicename'); ?>" id="post-<?php the_ID();?
   >">`
 * details depend on your theme; for more help, a link to your site is needed.
 *  Thread Starter [thisisedie](https://wordpress.org/support/users/thisisedie/)
 * (@thisisedie)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/post-author-highlight/#post-1619817)
 * Thank you SO much, that worked perfeftly :o)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Post Author Highlight’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [thisisedie](https://wordpress.org/support/users/thisisedie/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/post-author-highlight/#post-1619817)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
