How to set the target window for event url?

Home Forums Calendar Products Events Calendar PRO How to set the target window for event url?

  • This topic has 5 replies, 2 voices, and was last updated 8 years ago by zafari.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1475702
    zafari
    Participant

    I need to set the target to new window for the event url that displays on the event single page. How can I do this? It seems like a pretty basic feature that should already be in place….. thanks!

    #1476950
    Victor
    Member

    Hi Pamela!

    Thanks for getting in touch with us. Let me help you with this topic.

    By default the event website URL is targeted to open in the same tab, but we provide a filter to change exactly that.

    You can copy and paste the following snippet into your functions.php file to accomplish that:

    add_filter( 'tribe_get_event_website_link_target', 'blank_target_for_new_window' );
    function blank_target_for_new_window() {
    return '_blank';
    }

    Please try it out and let me know if it works for your site.

    Thanks,
    Victor

    #1476992
    zafari
    Participant

    Hello Victor!

    Thanks so much. I actually ended up following your tutorial to change
    the Event URL to a button that opens in a new window so that part is
    set. However, I’d like to use your solution below to also open the
    Organizer Website in a new window. What should I substitute for
    “tribe_get_event_website_link_target” to accomplish this?

    Thanks so much for our help!!!

    #1478430
    Victor
    Member

    Sure thing Pamela!

    For the organizer website link, you can use the tribe_get_organizer_website_link_target filter instead.

    I hope that helps! 🙂

    Best,
    Victor

    #1496543
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to set the target window for event url?’ is closed to new replies.