Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images won't resize on the live server #11

Open
lmartins opened this issue Dec 8, 2014 · 0 comments
Open

Images won't resize on the live server #11

lmartins opened this issue Dec 8, 2014 · 0 comments

Comments

@lmartins
Copy link

lmartins commented Dec 8, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant