Add a Custom Column in WordPress Posts and Custom Post Types Admin Screen
In this tutorial we will see how to add a new column to the WordPress Posts management screen and in this column we will show the Featured Image of each Post. This new column will also be added in the management screen of any active Custom Post Type.
Step 1. Activate Featured Images
In this tutorial we will use the functions.php file available in our active theme directory. If the file is not present, you can create a new one with the following contents:
First of all, check if the Featured Image is available on the Add New Post page:
If you don’t see the Featured Image box, add this line to functions.php:
1
add_theme_support(‘post-thumbnails’);
The add_theme_support() function registers support for the specified feature within the theme. The passed argument is a string that specifies the feature you want to add. In this case, it is post-thumbnails. Other values could be widgets, featured-content, menus etc.
1
add_image_size(‘featured_preview’, 200, 150, false);