Home › Forums › Calendar Products › Events Calendar PRO › Remove Venue Link
- This topic has 8 replies, 3 voices, and was last updated 6 years, 7 months ago by Ryan.
-
AuthorPosts
-
October 10, 2017 at 2:46 pm #1361799RyanParticipant
I’d like to remove the link of the venue but keep the venue name in all views, especially the single events view. I found this post (https://theeventscalendar.com/support/forums/topic/remove-the-venue-hyperlink/) but was unable to remove the hyperlink in the single events page. Could you please let me know the code to remove the venue links everywhere?
Thanks,
RyanOctober 11, 2017 at 7:31 pm #1362352VictorKeymasterHi Ryan!
Thanks for reaching out to us. I’d be happy to help you with this topic.
Try using the following snippet instead that remove the venue links from everywhere:
add_filter ( 'tribe_get_venue_link', 'tribe_remove_venue_link_list_view', 10, 4 ); function tribe_remove_venue_link_list_view ( $link, $venue_id, $full_link, $url ) { return tribe_get_venue( $venue_id ); }
Let me know if it works for you 🙂
Best,
VictorOctober 12, 2017 at 2:25 pm #1362914RyanParticipantHi Victor,
Unfortunately, it did not work. That may remove the link but the venue name is still clickable and opens up a page that looks like this: http://American%20Museum%20of%20Western%20Art
The link and the ability to click needs to be removed.
Thanks,
RyanOctober 13, 2017 at 8:19 am #1363211VictorKeymasterHi Ryan!
I’m sorry about that. I’ve just realized there is no easy way to completely remove the venue links from all parts of the site, because the tribe_get_venue_link()Â function is used in different ways across the templates.
I’ve found the following thread where Cliff shows a couple of different approaches depending on where to hide the venue links >Â https://theeventscalendar.com/support/forums/topic/remove-venue-link-3/
I hope it helps as a starting point. Do let me know if you have any questions or if you bump into any issues while coding it.
Best,
VictorOctober 13, 2017 at 9:18 am #1363240MathewParticipantRyan,
This snippet should remove the venue links from single events. Give it a try.
function tribe_remove_venue_link() {
remove_filter( 'tribe_get_venue', array( Tribe__Events__Pro__Main::instance()->single_event_meta, 'link_venue' ) );
}
add_action( 'tribe_events_single_meta_before', 'tribe_remove_venue_link', 100 );Hope this helps.
October 16, 2017 at 7:52 am #1364152VictorKeymasterHi Mathew! Thanks for chiming in! 🙂
Ryan, does the snippet Mathew shared here works for you?
Let us know about it.
Thanks,
VictorOctober 19, 2017 at 3:00 pm #1366197RyanParticipantHi guys,
Mathew’s code work!
Thank you both for all your help.
October 19, 2017 at 8:03 pm #1366269VictorKeymasterHey Ryan!
Great to know that! Thanks for following up to let us know about it.
Props to Mathew for sharing that code! 🙂
I’ll close this now, but as always feel free to open a new topic if anything comes up and we’d be happy to assist.
Cheers,
Victor -
AuthorPosts
- The topic ‘Remove Venue Link’ is closed to new replies.