Home › Forums › Calendar Products › Events Calendar PRO › Add Custom URL to Featured Image
- This topic has 4 replies, 2 voices, and was last updated 10 years, 2 months ago by
Brook.
-
AuthorPosts
-
February 10, 2016 at 8:19 am #1070897
reshetramah
ParticipantHi,
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.
February 10, 2016 at 12:43 pm #1071043Brook
ParticipantHowdy 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.
- 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.
- 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.
- 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
February 11, 2016 at 7:38 am #1071533reshetramah
ParticipantThis reply is private.
February 11, 2016 at 7:59 am #1071551reshetramah
Participantnevermind! there was an issue in the file, i fixed it. thanks!
February 11, 2016 at 11:45 am #1071670Brook
ParticipantExcellent! I am delighted the easiest solution was the one you needed.
Cheers!
– Brook
-
AuthorPosts
- The topic ‘Add Custom URL to Featured Image’ is closed to new replies.
