How to Add a Featured Image Column to WordPress Dashboard

The default post listing on the WordPress dashboard comes with various columns including title, author, categories, tags etc. But if the user want see the featured thumbnail image of a specific post on the dashboard, he needs to edit that specific post.

In this tutorial, I will show you how you can add an additional featured image column to the default post listing.

You might also like: How to Redirect your 404 page to the Home Page in WordPress

All you have to do is copy the following code snippet and paste it inside your functions.php file.

//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));
    }
}
Add a Featured Image Column to WordPress Dashboard

Add a Featured Image Column to WordPress Dashboard

0 Comments

Leave a Comment.