I have created a custom image field for a custom post type, how do I make the images retain their original aspect ratio?
In the image field in the custom post type, images are being force to fit the image sizes set in Settings > Media. (390x600 for medium images).
Example here:
hidden link
Hello,
I assume we are talking about the custom image field "Case Study Featured Image", you are using Types shortcode to display the custom image field, please try to add resize='crop' in the Types shortcode and test again, for example:
[types field='case-study-featured-image' alt='%%ALT%%' title='%%TITLE%%' size='medium' align='none' resize='crop'][/types]
More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
resize:
'crop' | 'proportional' | 'stretch' | 'pad'
Hi,
Yes, I can see where the shortcode needs to be modified, but I need to have it set it to the correct default in the custom image field.
I have to turn this site over to the client and can't ask her to edit a shortcode each time, the image has to be displayed correctly by default.
I remember there being a choice for how to display the image when I created the custom image field, but can't locate where to modify this now.
Since there's a setting for this somewhere, would rather not add PHP, just want to change the setting, but need help to find it.
Hope you can help.
Please elaborate the question with more details:
I remember there being a choice for how to display the image when I created the custom image field, but can't locate where to modify this now.
What kind of choice do you need when you create the custom image field?
You can specific the displaying settings when you insert the Types image shortcode, option "Pre-defined sizes" choose "Custom size..." , then you will be able to specific image displaying settings, see screenshot image-field.JPG