Making event links go direct to event website
-
I am trying to implement the customization in this post:
https://theeventscalendar.com/knowledgebase/make-links-event-go-straight-event-website/So I go into Appearance/Editor and bring up the functions.php file and insert the following code as found in the above link:
/*
* This changes the event link to the event website URL if that is set.
* NOTE: Comment out the add_filter() line to disable this function.
*/
function tribe_set_link_website ( $link, $postId ) {
$website_url = tribe_get_event_website_url( $postId );
// Only swaps link if set
if ( !empty( $website_url ) ) {
$link = $website_url;
}
return $link;
}
add_filter( 'tribe_get_event_link', 'tribe_set_link_website', 100, 2 );But doing so completely breaks the site. Like, visiting my website just produces a single line of text: error in line 191 of functions.php. Luckily I can just restore a backup copy of functions.php and it’s all good. Is there a termination line I’m missing here? The document makes it sounds like it’s a simple copy/paste, but it seems I’m missing a vital step here. Thanks in advance.
- The topic ‘Making event links go direct to event website’ is closed to new replies.