Home › Forums › General Issues › Image size: attachment display settings › Reply To: Image size: attachment display settings
Hi @dadra
You could create a select field and populate the choices with ‘thumbnail, medium, large, full, custom-size, etc’.
Then in your code, you can load in the image like so:
<?php
$image = get_field('image');
$size = get_field('size');
echo $image['sizes'][ $size ];
?>
The above example expects your image field to return an array of data, but you could change this to ID and modify the code as per the docs.
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.