Adding Venue Featured Image to Event Venue Box

Home Forums Calendar Products Events Calendar PRO Adding Venue Featured Image to Event Venue Box

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1221750
    Michael
    Participant

    Hey guys,
    My boss has asked me to pull in the featured image of the venue….. in the event page.
    So basically underneath the address of the venue you could also see a featured image of the venue.

    Now I know this is beyond the scope of knowledge for support, but it would be really cool of you guys if you could give me a pointer because I have found most of the code, I just need help with it.

    <?php string tribe_get_venue ( int $postId = null ) ?>

    <?php echo tribe_event_featured_image( null, ‘full’ ) ?>

    Can I somehow combine these, so the php gets the tribe venue’s featured image?

    #1221786
    George
    Participant

    Hey Michael,

    Thanks for reaching out!

    This is indeed beyond the scope of our support, as elaborated upon here → https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/

    I’d love to help you get going in the right direction, though, and hope to do so here! 😀

    What I would recommend doing is keeping in mind that Featured Images are a feature of WordPress itself—not something our plugins add, per se. And so I would recommend using the WordPress-default function get_the_post_thumbnail(), which you can read about here: https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

    So what you could do is just get the Venue ID for the Venue, and then pass it to the get_the_post_thumbnail() function. You can get the Venue ID with the function tribe_get_venue_id().

    So here’s an example of how that might look in an example of real code:


    echo get_the_post_thumbnail( tribe_get_venue_id(), 'full' );

    Let us know if this helps!

    — George

    #1233374
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Adding Venue Featured Image to Event Venue Box’ is closed to new replies.