Add Custom URL to Featured Image

Home Forums Calendar Products Events Calendar PRO Add Custom URL to Featured Image

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1070897
    reshetramah
    Participant

    Hi,

    I would like to link directly from the featured image in the photos view on our event calendar to an external url. http://reshetramah.org/events. I have seen some forums (https://theeventscalendar.com/support/forums/topic/adding-a-link-to-featured-image/) about this but it looks like any code posted in those has been deleted.

    #1071043
    Brook
    Participant

    Howdy reshetramah,

    That’s a great question. I can think of three ways to do this, and I’ll outline each of them below so you can decide which works best for you.

    1. Are your trying to make the link go to the external website only in photo view, or elsewhere on your site such as in Month view? If you would like to do this then there is a fairly straightforward method of doing this. When you add the event from WP Admin you can setup an external URL for that event in the Event Website field. Once you’ve input that data, try following the steps in this article. That will make it so that anytime someone click on the event, they are taken to the external website instead of the usual single event page.
    2. Another option without the caveat of working in every view would be to create a theme override, by following our Themer’s Guide. The file you wish to override is :/events-calendar-pro/src/views/pro/photo/single-event.phphttps://theeventscalendar.com/knowledgebase/make-links-event-go-straight-event-website/. You will notice the call to tribe_event_featured_image() on line ~24. That is the featured image, you could swap this out for a link of your own.
    3. Finally similarly to the above, you could override the image itself using the WP Filter ‘tribe_event_featured_image’

    Certainly all of these will require a bit of PHP knowhow to get working. Though the first one is probably the easiest. Does one of these sound preferred to you? Can I clarify how to go about that preferred method any?

    Cheers!

    – Brook

    #1071533
    reshetramah
    Participant

    This reply is private.

    #1071551
    reshetramah
    Participant

    nevermind! there was an issue in the file, i fixed it. thanks!

    #1071670
    Brook
    Participant

    Excellent! I am delighted the easiest solution was the one you needed.

    Cheers!

    – Brook

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Add Custom URL to Featured Image’ is closed to new replies.