and like us on FB

If you’re a WordPress user, and you’re anything like me, you will write a bunch of articles and forget to set the associated featured image. If you manage multiple users you also might find yourself logging in to check others have done the same. The following WordPress function (or plugin) will add a featured image column with an image preview on your ‘All Posts’ menu in the WordPress administration panel.

Once you have made the necessary modification, your admin panel will look like this:

WordPress Featured Image Preview In Your Admin Post Menu

Scaled featured image alongside other post details.

add_image_size() Function

When an image is uploaded via the WordPress upload tool, it is automatically scaled to various dimensions as defined in your ‘Settings ► Media' administration menu (or the custom sizes defined by you or your theme). The problem with this (and its compatibility with our little function) is that we’ll reference the raw unscaled (original, larger) image. While the larger image won’t distort your page, necessarily, it will increase page-load time. For that reason, we’ll use the WordPress the_post_thumbnail() function to create an image size of our choosing that fits nicely into our newly created featured image column. An image dimension of 60×60 seems to work well although you could choose whatever you want.

add_image_size('admin-list-thumb', 60, 60, true);

Related WordPress functions if you’re interested in further reading: add_image_size() , get_the_post_thumbnail() , get_post_thumbnail_id() , set_post_thumbnail_size() , has_post_thumbnail() .

The Function

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.

If you’re happy to use the smallest thumbnail that WordPress creates by default (150×150), or if you’re already using smaller dimensions, you could change echo the_post_thumbnail( 'admin-list-thumb' ); on line 32 to echo the_post_thumbnail('thumbnail');, and remove or comment out the add_image_size() function to create a new image.

Download the Code

The version intended to be pasted in your custom functions file is listed as shortcode.

Download: Shortcode (V) | WP Plugin (V) |

Shortt URL for this post: