Support

Home Forums Event Espresso Premium Featured Image Size – event-list-display.php

Featured Image Size – event-list-display.php

Posted: September 4, 2012 at 10:37 am


Stefan Hansen

September 4, 2012 at 10:37 am

Hi,

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?

Thanks!
Stefan


Stefan Hansen

September 4, 2012 at 1:51 pm

Realized I forgot the snippet:
echo $event_meta[‘event_thumbnail_url’]

Any thoughts on being able to pull different sizes?


Chris Reynolds

  • Support Staff

September 4, 2012 at 5:32 pm

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.


Stefan Hansen

September 4, 2012 at 5:45 pm

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!

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.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Stefan Hansen 7 years, 2 months ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!