robert-o
8/14/2017 - 7:31 PM

How to show featured images in list view https://wp-types.com/forums/topic/how-to-show-featured-images-in-list-view-back-end/

function add_featured_image_column($defaults) {
    $defaults['featured_image'] = 'Featured Image';
    return $defaults;
}
add_filter('manage_company_posts_columns', 'add_featured_image_column');
 
function show_featured_image_column($column_name, $post_id) {
    if ($column_name == 'featured_image') {
        echo get_the_post_thumbnail($post_id, 'thumbnail'); 
    }
}
add_action('manage_company_posts_custom_column', 'show_featured_image_column', 10, 2);

//You need to replace 'company' with your custom post type slug in both hook names.