so I know I can show the featured image in the event list by adding the code below to my event-list-display.php file. This works great.
I’m wondering if there is a way for me to pull a smaller version of this image (small, medium, large), so I can use the large images (800×800) on the individual event listing pages?
You would need to create a new ee meta key pair and use that ee meta value in your templates (and use a different image as the value in the meta box). And, of course, this isn’t part of the featured image uploader, so you wouldn’t have the media uploader to work with (or, you could use it, but you could only do so by uploading via the uploader and then copy/pasting the url to the image size you wanted to use into the ee meta value box).
ALTERNATELY:
You could maybe write a function that does a str_replace on the event_thumbnail_url and finds the .jpg in the value and replaces it with -150×150.jpg (or whatever size you want to use) since those alternate sizes should be created by WP when the image is uploaded via the media uploader.
That makes sense – I wasn’t sure if the smaller sizes were being created, but I just checked and they do. The string replace function seems like the logical way to go – thanks Chris!
Viewing 3 reply threads
The support post ‘Featured Image Size – event-list-display.php’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.