Display a Thumbnail in Your Admin Panel Post List

If you followed along yesterday, we set up a new thumbail size to be used in our admin panel. I find this a handy feature because I like to be able to see things. It helps jog my memory on each post. Besides that, it’s just plain cool. Let’s take a look how to add our new image size into the admin panel posts list.

It’s a real simple block of code to drop into your functions.php. The only thing you may need to tweak is in line 11, where it says admin-thumb. That refers to the image size I added yesterday. If you named your image size something different, swap it out there. Make sure the image size you add in is an appropriate size. Not too big, or your admin panel will be a mess. Here’s the code:

// THUMBNAILS TO ADMIN POST VIEW
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);

function posts_columns($defaults){
    $defaults['voodoo_post_thumbs'] = __('Thumbs');
    return $defaults;
}

function posts_custom_columns($column_name, $id){
	if($column_name === 'voodoo_post_thumbs'){
        echo the_post_thumbnail( 'admin-thumb' );
    }
}

After you get that dropped in your functions.php and saved, visit your posts screen from the admin panel and check it out. I think that’s pretty cool!

7 Replies to “Display a Thumbnail in Your Admin Panel Post List”

  1. Wow, this is great. I’ve been looking everywhere for something like this. Thank you. I just have a quick question. How would you fix it so you make the images a certain size, so they’re not too big?

  2. Hey i would love these feature to work i am currently getting this error
    Fatal error: Call to undefined function add_filter() in /home/dodgy/public_html/wp-includes/functions.php on line 3863

    I am pasting the code at the very bottom of the functions.php

    Any help is appreciated.

    1. You are pasting that in wp-includes/functions.php? Easy fix! First up, never ever edit any WP core files. That’s the files in wp-admin and wp-includes. The functions.php being referred to here is in your theme! ALso, depending on your theme, you might need a child theme http://vudu.me/child – Themes that come with WP (2010, 2011, 2012) and some other themes that get regular updates shouldn’t be directly edited.

      1. Thats for prompt reply, thanks for the correction i am still getting my head around wordpress.
        The problem is fix and is working great.
        Thank you

Leave a Reply