Feature Image On Post Dashboard (PHP)

Estimated reading: 3 minutes 12 views

Why would you want to have a feature image on your post dashboard? Adding featured images to your post dashboard is a smart way to quickly spot duplicates, verify image sizes, and keep everything visually organized—without needing to open each post. It’s especially helpful when managing a large number of articles and improves your overall workflow and user experience.

How does the code snippet work? It will add another column to the right side of your post dashboard and display the original feature image and dimensions. If no featured image exists, it outputs a dash (). With this code, you get both a visual reference and a quick check on image sizing.

Here’s the exact snippet we use on our websites, the instructions are below the snippet code.

Code Snippet

add_filter( 'manage_posts_columns', 'add_featured_image_column' );
add_action( 'manage_posts_custom_column', 'display_featured_image', 10, 2 );

function add_featured_image_column( $columns ) {
    $columns['featured_image'] = __('Featured Image');
    return $columns;
}

function display_featured_image( $column, $post_id ) {
    if ( 'featured_image' === $column ) {
        $thumbnail = get_the_post_thumbnail( $post_id, [80, 80] );

        $image_id = get_post_thumbnail_id( $post_id );
        if ( $image_id ) {
            $image_meta = wp_get_attachment_metadata( $image_id );
            if ( $image_meta ) {
                $width = $image_meta['width'];
                $height = $image_meta['height'];
                echo $thumbnail . '<br><small>' . $width . ' × ' . $height . 'px</small>';
            } else {
                echo $thumbnail;
            }
        } else {
            echo '—';
        }
    }
}

Where to Add This Code

Here are two easy options:

Option 1: Install WPCode Lite Plugin

This is by far the safest method and is beginner friendly if you’re not used to editing theme files.

  1. Search for WPCode Lite plugin in your website dashboard.
  2. Install and activate the plugin.
  3. Go to Snippets > Add New.
  4. Give your snippet a name like “Feature Image On Post Dashboard.”
  5. Paste the code above.
  6. Choose “Run snippet everywhere”.
  7. Choose PHP, not CSS or any other.
  8. Save and activate.

✅ Done! Feature images on your post dashboard are now enabled.

Option 2: Functions.php

We don’t advise this option unless you’re a developer or if you feel comfortable editing theme files:

  1. Open your functions.php file.
  2. Paste the snippet at the bottom.
  3. Save and upload if needed.

💡 Tip: Always use a child theme to avoid losing changes when your theme updates.

NOTE: We use WPCode Lite because it’s more flexible than others, there’s no need to upgrade to pro unless you’re a developer, it offers many free snippets, can choose where to run it, won’t publish if the code is wrong so won’t break your site, PHP is included compared to others you have to buy the their pro, and best of all the free version can easily be downloaded from your WordPress Repository.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

Feature Image On Post Dashboard (PHP)

Or copy link

CONTENTS

Join The Party For Fun Updates freebies & Big Discounts!

Add your name
Add your email

JoiN Glamsy Cloud! Free STUNNING Kadence Templates Included!

Start with 5 gorgeous Kadence blocks on us. Love them? Unlock ‘50 FREE FOREVER‘ that’s 50 more free blocks just for choosing any essential tool from our trusted fav stack!

Grab Your Free Templates

🔥 Hot June Freebie! Win A Premium Theme—No Cost, No Catch

Review Your Cart
0
Add Coupon Code
Subtotal

 

Subscribe

×
Cancel