Home › Forums › Calendar Products › Events Calendar PRO › Adding a link to Featured Image
- This topic has 13 replies, 4 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
March 6, 2012 at 3:07 pm #16319
Catherine
MemberIs there a way to have the featured image link to an external url? I’ve tried to add it to the link URL in the featured image settings but it disappears on save. I know this is probably a general WP issue, but any help is appreciated.
March 7, 2012 at 8:23 am #16359Rob
MemberHi there Catherine. I believe you are correct in that this is a WordPress behavior (as I’ve never been able to link a featured image on any site I’ve worked on), but let me get Jonah from our dev team to take a quick look and confirm whether I’m right here.
March 7, 2012 at 10:45 am #16393Jonah
ParticipantHi Catherine, this is a matter of templating where you need to wrap your featured image code in the link you want to use. I’m guessing it will be a custom field as well? So, wherever in the template (whether in /wp-content/plugins/the-events-calendar/views/table.php or /wp-content/plugins/the-events-calendar/views/single.php) you’ll need to find where the featured image code is and wrap the thumbnail code in your link code. For instance, here is the thumbnail code in single.php (single events views) with a custom field for a link wrapped around it:
https://gist.github.com/1995059
Does that help?
March 7, 2012 at 2:22 pm #16409Catherine
MemberThanks very much guys! I’ll give this a try.
March 8, 2012 at 11:00 am #16458Rob
MemberExcellent! If you need anything else after giving it a go, Catherine, just holler.
March 22, 2012 at 8:41 pm #17090Catherine
MemberI’m back. I’ve got a link now working on the feature image (had to modify the code you gave me slightly) but now the problem is getting it to link to my custom field. I created a custom field (using the WP custom fields section) but my image just links back to the event. Is there another place I should be creating the custom field?
Here is modified the code I used (without the quotes):
”
<a href="”>
“March 22, 2012 at 8:48 pm #17091Catherine
MemberSorry…here is a link to the code:
March 23, 2012 at 5:50 pm #17122Rob
MemberHi Catherine. Thanks for this; not sure how to approach it myself, but let me see if Jonah can share any thoughts.
March 26, 2012 at 4:22 pm #17174Jonah
ParticipantHi Catherine, so you are working with WP custom fields and not the Tribe custom fields? Try the code I just commented with here: https://gist.github.com/1995059#comments
Make sure to replace ‘img_link’ with whatever the key of your custom field is.
March 26, 2012 at 5:44 pm #17178Catherine
MemberHi Jonah,
I’m not sure how to work with the Tribe custom fields…I don’t see where to set them up. I’ve tried your fix and can’t get it to work. The url on the image just comes up as “/Array” (with the website domain in front) rather than the url I’ve put in as my field value.
March 26, 2012 at 5:47 pm #17180Jonah
ParticipantHi Catherine, do you have custom fields setup using the standard WP custom fields or the Tribe custom fields? The Tribe custom fields can be configured in Settings > The Events Calendar (and if you’re on 2.0.5 click into the new Additional Fields tab on the top). Otherwise the additional fields will be at the bottom of the settings page.
If you haven’t already configured any custom fields anywhere then the above code is not going to help you. You need to add the custom field, then add the custom field values on your event posts and then the code should spit out the custom link.
March 26, 2012 at 6:51 pm #17192Catherine
MemberSuccess!! Created a Tribe custom field and it works. Thanks Jonah for all your help and patience!
March 26, 2012 at 8:51 pm #17193Jonah
ParticipantAwesome Catherine, glad you got it working!
July 6, 2015 at 5:00 pm #976414Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Adding a link to Featured Image’ is closed to new replies.
