Remove Venue Link

Home Forums Calendar Products Events Calendar PRO Remove Venue Link

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1361799
    Ryan
    Participant

    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,
    Ryan

    #1362352
    Victor
    Keymaster

    Hi 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,
    Victor

    #1362914
    Ryan
    Participant

    Hi 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,
    Ryan

    #1363211
    Victor
    Keymaster

    Hi 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,
    Victor

    #1363240
    Mathew
    Participant

    Ryan,

    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.

    #1364152
    Victor
    Keymaster

    Hi Mathew! Thanks for chiming in! 🙂

    Ryan, does the snippet Mathew shared here works for you?

    Let us know about it.

    Thanks,
    Victor

    #1366197
    Ryan
    Participant

    Hi guys,

    Mathew’s code work!

    Thank you both for all your help.

    #1366269
    Victor
    Keymaster

    Hey 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Remove Venue Link’ is closed to new replies.