Home › Forums › General Issues › Image size: attachment display settings › Reply To: Image size: attachment display settings
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.
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.