Skip to content

Instantly share code, notes, and snippets.

@jymartineau
Created May 12, 2015 16:55
Show Gist options
  • Save jymartineau/685651f11ddd1211b260 to your computer and use it in GitHub Desktop.
Save jymartineau/685651f11ddd1211b260 to your computer and use it in GitHub Desktop.
How to Add a Featured Image Column to WordPress Dashboard
//Add a Featured Image Column to WordPress Dashboard
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
function posts_columns($defaults){
$defaults['riv_post_thumbs'] = __('Featured Image');
return $defaults;
}
function posts_custom_columns($column_name, $id){
if($column_name === 'riv_post_thumbs'){
echo the_post_thumbnail(array(100,100));
}
}
@jymartineau
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment