Created
May 19, 2016 15:52
-
-
Save Basilakis/5caaf6fac729de4b7c768663389f7adf to your computer and use it in GitHub Desktop.
WordPress Function, New Window on Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_footer','open_link_new_window'); | |
function open_link_new_window(){ | |
?> | |
<script> | |
jQuery(function() { | |
function handle_cta( ev ) { | |
var href = jQuery( this ).attr( 'href' ); | |
window.open( href, '_blank' ); | |
return false; | |
} | |
jQuery(document).on('click', '.inpage-scroll', handle_cta); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment