Home › Forums › Calendar Products › Events Calendar PRO › Redirect specific events to custom pages
- This topic has 11 replies, 2 voices, and was last updated 6 years, 1 month ago by Raymond Gillespie.
-
AuthorPosts
-
February 7, 2018 at 4:07 am #1446109Raymond GillespieParticipant
Most of our events are fine and work normally, but a few of them require a specific set of content that can’t easily be achieved with the standard event post template, and therefore have their own pages set up based on custom templates. Is there any way that, when a user clicks on the event title for these specific events, they can be redirected to the custom page in question, rather than the event post?
February 7, 2018 at 11:17 pm #1447250JenniferKeymasterHi Raymond,
I think your best bet here would be to edit the templates for the views that you are using. You can do this by following the instructions in our themer’s guide. So for example, if you wanted to edit the link to the single event in month view, you would want to edit the template found at wp-content/plugins/src/views/month/single-event.php. There, you will find a $link variable that is storing the link to the single event, and the following line, where the link is being output (line 196):
" class="url">
After you’ve copied this template into your child theme (following the instructions in our themer’s guide), you can edit the link there.
We are a bit limited in the amount of support that we can provide for customizations, but if you get stuck or have any questions, please let me know. I will be happy to point you in the right direction!
Thanks,
Jennifer
February 8, 2018 at 2:30 am #1447370Raymond GillespieParticipantHello,
Thanks for the update, that makes sense. So in theory, we could, for example, wrap this in an if statement that produced a different type of link based on the category in question? If so, do you know which variable we can use to determine the category type?
February 8, 2018 at 11:49 am #1448122JenniferKeymasterSure thing! You can use the tribe_event_in_category function to check if an event has a certain category. Our functions list has several other functions like this, so I would definitely recommend this as a resource when customizing our plugins.
February 9, 2018 at 5:25 am #1448775Raymond GillespieParticipantThanks!
February 9, 2018 at 10:25 am #1449248Raymond GillespieParticipantHi again,
I have almost got this sorted. However, I can’t find the template that links the image of photo mode through to the event post. I have looked in photo/single-event.php but even when I remove the link from that entirely I still have the image linking through to the event post. Should I be looking somewhere else?
This is all based on photo mode BTW (probably should have said that sooner!)
February 12, 2018 at 12:20 pm #1451012JenniferKeymasterHi Raymond,
Thanks for clarifying that you’re using photo view! You can remove the link from the image by changing this line in the photo/single-event.php file:
to
If you want to change the link for the image, you can use the tribe_event_featured_image_link filter (see the tribe_event_featured_image function in – line 920 – in wp-content/plugins/the-events-calendar/src/functions/template-tags/general.php).
Let me know if this helps!
February 12, 2018 at 12:32 pm #1451029Raymond GillespieParticipantAh great thanks, I think I found the filter I need:
if ( ! empty( $featured_image ) && apply_filters( 'tribe_event_featured_image_link', $link ) ) { $featured_image = '<a href="' . esc_url( tribe_get_event_link( $post_id ) ) . '">' . $featured_image . '</a>'; }
Do I add this to functions.php to override the copy in the plugin folder?
February 13, 2018 at 8:10 am #1451707Raymond GillespieParticipantIt’s OK, I got it sorted – I disabled the link and wrapped the whole div in the link I was using for the title – works fine now, thanks.
February 13, 2018 at 10:26 am #1452058JenniferKeymasterGreat, I’m glad to hear it’s working now!
If there’s anything else that I can help with, please let me know 🙂
March 7, 2018 at 8:35 am #1472270Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Redirect specific events to custom pages’ is closed to new replies.