Field to select registered image sizes within the WordPress dashboard.
This ACF field type is compatible with:
* ACF 5
How to Use
Once activated, this plugin will create a Image Size field type in ACF. This field type will list all registered field types as a drop down within the field group.
To use this field within your custom templates you will use the following code:
$my_image_id = get_field('my_image_id'); // ACF Image return type set to ID for this demo $my_image_size = get_field('my_image_size'); // The selected image size (eg. large) echo wp_get_attachment_image( $my_image_id, $my_image_size ); // Output the image based on the ID, and the Image Size selected.
- Copy the
acf-image-size-selectfolder into your
- Activate the Image Size Select plugin via the plugins admin page
- Create a new field via ACF and select the Image Size Select type
Feb 13, 2019
This worked perfectly for me - had to change my code slightly to work with image ID's and a repeater field, but was very easy to do. Thank you for your work!!
Contributors & Developers
“Advanced Custom Fields: Image Size Select Field” is open source software. The following people have contributed to this plugin.Contributors
Translate “Advanced Custom Fields: Image Size Select Field” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
- Added medium_large to list of WordPress images to check
- Removed automated github to SVN sync
- Updated line formatting
- Added github to SVN sync
- Initial Release.