By default, WordPress post management section does not include a feature to display images. In this article, I will provide you with two methods to add featured thumbnail to post column WordPress Admin, which will enhance the visual appeal and aesthetics of your posts.
Displaying Featured Images in WordPress Admin
Download and install our simple plugin, developed by ItsmeIT, using the standard WordPress plugin installation process.
Key Features:
- Adds a new “Screen Options” filter
- Introduces a “Featured Image” column in the post list
This plugin enhances your WordPress admin interface by displaying post thumbnails directly in the post management area. See the screenshot below for a visual reference.
With this plugin, you can quickly identify posts with featured images, streamlining your content management process.
Add Code to Display Featured Images Without a Plugin
If you are comfortable with adding code to WordPress, we provides steps on how to add the featured image column to the posts management panel. This process involves using specific functions, such as “add_filter” and “add_action”, to achieve the desired result.
add_filter('manage_posts_columns', 'add_thumbnail_column', 10, 1);
function add_thumbnail_column($columns)
{
$new_columns = array();
$new_columns['thumbnail'] = __('Thumbnail', 'text-domain');
$columns = array_merge($new_columns, $columns);
return $columns;
}
add_action('manage_posts_custom_column', 'display_thumbnail_column', 10, 2);
function display_thumbnail_column($column, $post_id)
{
if ($column === 'thumbnail' && has_post_thumbnail( $post_id ))
echo get_the_post_thumbnail($post_id, array(120, 9999));
}
The add_filter
function is used to add a new column for featuring thumbnails in the WordPress Admin post management page. The add_action
function then registers a callback function that will populate this new column with content.
The add_thumbnail_column
function defines the new “Thumbnail” column and adds it to the list of columns displayed in the post management page.
The display_thumbnail_column
function is responsible for displaying the actual featured image in the newly added column. It checks two conditions:
- Whether the current column is the thumbnail column
- Whether the post has a featured image
If both conditions are met, the function retrieves and displays the featured image of the post in the new column.
These functions work together to enhance the WordPress Admin interface, allowing you to see featured images directly in the post list, which can significantly improve content management efficiency. You only need to add this code to your theme’s functions.php
file to implement this feature without using a plugin.
Read more: How to add filter Posts by Date in Admin WordPress