I have created a search using views. In the content block, I have a field called thumbnail. I need help in doing the following.
1) The thumbnail size should be 300*300. Though I have set the value, it exceeds.
hidden link
2) I want to output results on the conditional basis
i) If the thumbnail does not exist, I want to show an image from another field say Add photos field where photos may exist.
ii) If both fields are empty, I would like to show a default image.
Thank you for your support
Hello,
Q1) The thumbnail size should be 300*300. Though I have set the value, it exceeds.
How do you setup the field "thumbnail"? Is it a custom image field?
If it is, you can follow our document to display the custom image field in specific size:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
size:
custom image size | 'full' | 'large' | 'medium' | 'thumbnail'
width and height will be ignored if size is set.
Q2) I want to output results on the conditional basis
I suggest you follow our document to setup the [wpv-conditional] shortcode and display the image you want:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/