Change Width of Featured Image Thumbnail on Add/Edit Post Page

Does anyone know of a way to change the width of the featured image on the edit post/add post page? I want to make it 50px wide. I’m not talking about the front page of the website, but the back end where you’ve selected the feature image and it sits next to your post as you’re typing. Thank you! 🙂

Related posts

1 comment

  1. Okey i think i understand what you want to do.

    Here is a function that changes the html-output of the feature image in admin. It will look for the attached feature image ID and output it by using wp_get_attachemt_link() so you can change the size by the parameter $size. Here is a function that should work:

    function wpse_111428_change_feature_image_admin( $content ) 
    {
        global $post;
        $size = 100;
    
        $id = get_post_meta( $post->ID, '_thumbnail_id', true );
    
        if( $id )
        {
            return wp_get_attachment_link( $id, array( $size, $size ) );
        }
    }
    add_filter( 'admin_post_thumbnail_html', 'wpse_111428_change_feature_image_admin' );
    

    I found the original code in wp-adminincludespost.php that WordPress uses to output the feature image.

Comments are closed.