1

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! :)

0

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-admin\includes\post.php that WordPress uses to output the feature image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.