Hey there epixmedia. Thanks for the note here; we should be able to help you out here, but can you clarify what exactly you’re trying to do? When you say “medium image,” you mean the mid-size offering WP presents upon uploading an image? And are you adding this via the “featured image” functionality, or just dropping it into a post’s entry body?
Let me know your thoughts here and we can try to guide you appropriately.
Thread Starter
Zoee
(@epixmedia)
Hi Rob, yes I want to use the medium image already created and stored when the image was uploaded.
I’m also adding the image as a featured image, its then automatically displayed in the post (using the thumbnail code that’s in the template). I want to change this thumbnail code to display the medium image.
Cheers 🙂
Thread Starter
Zoee
(@epixmedia)
Are you able to help me with this one at all Rob?
Hey there epixmedia. Thanks for the follow-up; we generally only have the bandwidth to hit the forum here at WordPress.org once a week or so….my apologies for taking until now to get back to you. (We do provide daily & generally more comprehensive support for PRO users at the tri.be forums, if you ever find yourself in need of a quick turnaround).
But as for this issue….we should certainly be able to point you in the right direction. The specific question is outside my area of expertise so I have asked a member of our dev team to take a look when they hit the forums this afternoon. Stay tuned and my apologies again for the delay thus far.
Thread Starter
Zoee
(@epixmedia)
Thanks Rob, I’ll await their feedback!
I should be upgrading to the pro version later in the year as we may need to write a module to work with your system!
Hey epixmedia,
You may not be getting anything because you are trying to get a picture with an ID that has not been set ($picture->ID) – where is $picture being populated? If it’s not being assigned to the current event ID, then it won’t work… So if you’ve got this in a custom loop you’ll need to make sure that $picture is the array of objects being returned for the query. Which it won’t be by default. Try $event->ID instead.
By default the single event template uses the_post_thumbnail() to display the featured image for an event. If you look at the codex for: http://codex.wordpress.org/Function_Reference/the_post_thumbnail – you’ll see that you can pass size parameters to that function to determine what size image is used. So you should be able to use the following:
the_post_thumbnail('medium');
Does that help?
also, make sure if you are editing the single event template that you make a copy of /wp-content/plugins/the-events-calendar/views/single.php and place in an ‘events’ folder to preserve your changes.
Thread Starter
Zoee
(@epixmedia)
Thanks!
the_post_thumbnail('medium');
Worked a treat, surprised I didn’t spot this on my initial hunt!
My files are already copied to my theme folder so no worries there 🙂
Awesome to hear epixmedia! Let us know if there’s anything else we can help you with.