-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Im trying to add a image preview on a custom post type, being the image itself provided by ACF. Locally on my machine it works as expected, although on the live server the thumbnails won't get resized and always show full-size.
The code im using for this is:
Jigsaw::add_column('banners', 'Preview', function( $post_id ){
$banner_type = get_field('banner_type');
if ( $banner_type === "Banner Top" ) {
$image = get_field('banner_top_image');
} else {
$image = get_field('banner_action_image');
}
$post = new TimberPost($post_id);
if ( strlen( $image ) ){
$post->preview = new TimberImage( $image );
}
$data = Timber::get_context();
$data['post'] = $post;
Timber::render('admin/banners-image-preview.twig', $data);
}, 1);
And the contents of the template are just:
<img src="{{post.preview.src|resize(100, 80)}}" />
Any thoughts of what might be happening?
Thanks
Metadata
Metadata
Assignees
Labels
No labels