Images for venue and organizer (revisited… again)

Home Forums Calendar Products Events Calendar PRO Images for venue and organizer (revisited… again)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1174192
    Tamara Pickrell
    Participant

    Yes, it’s me again… pursuing the objective discussed here:

    Images for location and presenter (revisited)

    [When I started that one I forgot that I had already renamed my Venue and Organizer labels to Location and Presenter. I’m going back to the original names in the title of this thread since those might be better keywords.]

    Basically I want my single event view to show the featured images for the venue and organizer.

    Geoff said:

    3. Steal the code that displays the pictures in the single organizer and in the single venue view
    4. Add them to the single-event view

    I couldn’t see a good place to add the lines to the single-event view, so instead I decided I should copy and edit the Venue and Organizer elements which I found here: /the-events-calendar/src/views/modules/meta/.

    Then I found Single-Venue and Single-Organizer here: /events-calendar-pro/src/views/pro/ and grabbed the lines circled in the attached images and put them into the Venue and Organizer copies in my theme. I thought those lines seemed like a reasonable guess, since they’re labeled “Organizer Featured Image” and “Venue Featured Image,” but instead I’m getting the event featured image in both places.

    So obviously I’ve not done it quite right, but I feel like I’m close. Can you help me along?

    #1174684
    Andras
    Keymaster

    Hello Tamara,

    Thanks for getting back in touch again and for clarifying your question. I can help you out here.

    It looks like you just might be able to make it without customizing any templates. Add this below snippet to your child theme’s functions.php file and the venue and organizer images will magically 🙂 appear:

    https://gist.github.com/andrasguseo/3396c6dba948d789e2937857beff7b47

    There are some settings detailed at the beginning of the snippet.

    Also, if you want to put the images at the beginning of their respective sections, then you can change tribe_events_single_meta_organizer_section_end to tribe_events_single_meta_organizer_section_start and the same for the venue respectively.

    Afterwards you can still do some formatting with CSS.

    Let me know if this helps you.

    Cheers,
    Andras

    #1174780
    Tamara Pickrell
    Participant

    Thanks very much! That works perfectly. Just two questions:

    1. I’ve set a caption for the venue image and I’d like to have that display along with the image. I added an echo line to the snippet and that works, but maybe there’s a better/more elegant/more proper way to do it?
    2. Just curious — was I at all close in the way I was trying to do it? I really thought I was on the right track, finding the “Venue Featured Image” and “Organizer Featured Image.” It helps me better understand what I’m doing with Themeing if I know whether or not I was going in the right direction.

    Thanks!

    #1174824
    Andras
    Keymaster

    Hey Tamara,

    I’m super stoked to hear it helped! (This was the first snippet I did without any help. 🙂 So it’s a double success for me. 🙂 )

    1. The echo should be just fine. I don’t know any better solution from the top of my head. You can check this article for some info, but it also uses echo. So you are good there.

    http://www.wpbeginner.com/wp-tutorials/how-to-display-wordpress-post-thumbnails-with-captions/

     

    2. I’m very happy you asked this! Always happy to see people who want to learn more.

    You were pretty close, yes. It would also be possible to do this as a template override easily. (That was my first thought too.) The only thing you were missing from the function(s) is replacing the null with $venue_id = tribe_get_venue_id(); and the same for organizer respectively.

    Adding the image size and the true/false for making it a link is just a bit of beautification.

    So congrats!!! You were really close to nailing it!

    And although the function is called tribe_event_featured_image it retrieves the featured image of the post / custom post whose id you provide as a parameter. This is because all posts and custom posts are stored in the same database and all the IDs are totally unique, irrespective of their type.

    Let me know if there is anything else I can help you out with, or if I can close this thread.

    Have a wonderful day!

    Cheers,
    Andras

    #1176319
    Tamara Pickrell
    Participant

    Thank you for this explanation. I didn’t know that about how images are stored, and this is interesting and useful.
    This issue is working perfectly now, and I will mark the thread as resolved.
    Thanks!

    #1176425
    Andras
    Keymaster

    Hey Tamara,

    I’m stoked to hear the issue is resolved! Woohooooo!

    I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic in the forum and we will help you out.

    Good luck with your project!

    Cheers,
    Andras

    PS: If you like our plugin, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Images for venue and organizer (revisited… again)’ is closed to new replies.