Open Organizer and Venue Links In New Window

Home Forums Calendar Products Events Calendar PRO Open Organizer and Venue Links In New Window

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1053258
    Scott
    Participant

    I have read the forums but either the information was outdated (understandably since there are updates to the plugin) and either the instructions didn’t match the current files or in one case, broke the site. I would like the links from a single event page to open in new windows for both the Organizer and Venue Links. I found the code for the Organizer in organizer.php but I couldn’t get target=”_blank” to work.

    Maybe in future releases you have the option to select if a link opens in a new window. But for now, how can I do it and I don’t mind altering plugin files.

    Thank you,
    Scott

    #1053278
    George
    Participant

    Hey Scott,

    We unfortunately cannot help out with customizations, so you’ll have to take the reins on this. Please see the “Product Support” section of this page for more information → http://theeventscalendar.com/terms

    With that being said, I hope I can help at least a bit here – a simple method for doing what you ask is to implement a JavaScript solution by using the code below. You can do this by copying the code below and pasting it into your theme’s functions.php file:


    add_action( 'wp_footer', 'wp_make_all_links_open_in_new_window' );

    function wp_make_all_links_open_in_new_window() {
    ?>
    <script>
    (function () {
    var links = document.getElementsByTagName( 'a' );
    for ( var i = 0; i < links.length; ++i ) links[i].target = '_blank';
    })();
    </script>
    <?php
    }

    Ensure that any other customizations you have tried thus far are removed – get rid of any previously-attempted code solutions for this functionality. Then, add in the code above to your theme’s functions.php and see how things behave.

    Best of luck with your customization,
    George

    #1076644
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Open Organizer and Venue Links In New Window’ is closed to new replies.