Drupal tip: Style admin nodes

I was recently searching for a snippet that would add a class to nodes created by the administrator. Rather simple and straightforward, but didn’t find anything. If you’re just starting out in theming, it could help you understand how things work a bit. Here is the code you add in your theme’s template.php file:

function [your_theme_name]_preprocess_node(&$vars) {
if ($vars['uid'] == 1) {
$vars['classes_array'][] = ‘adminpost’;
}
}