I want to be entirely clear about this, what I’d like to do is change the size of the featured image thumbnail on the ADMIN panel, not on the front end.
I’m building a WP-admin theme, and I need to make the featured image larger on the back end.
It seems, featured images in the edit-post screen always spit out at 266x148px, ideally I’d like them to be actual size.
I’ve searched around and can’t find any hooks or functions that’d let me do this, but if anyone knows how, it’s the people on here.
You can filter
'admin_post_thumbnail_html'
and replace theimg
element with a new one in the size you need.Everything else will get messy and might lead to side effects.
image_downsize
while watching for a size of266Ã266
might affect images that are not meant to be shown in the metabox.post-thumbnail
temporary is not easy, because there are no safe points to start and end such a filter.Starting in WordPress 4.4, a new filter was introduced,
admin_post_thumbnail_size
, which allows for modifying the display size of the post thumbnail image in the Featured Image meta box.We can use this filter to alter the
post-thumbnail
size (266 x 266 px) and modify it to use the defaultthumbnail
size (150 x 15 px) instead.A specific size (e.g., 100 x 100 px) can also be specified or set as a fallback in case the intermediate thumbnail size isn’t available.
You could try this