Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Basilakis/5caaf6fac729de4b7c768663389f7adf to your computer and use it in GitHub Desktop.
Save Basilakis/5caaf6fac729de4b7c768663389f7adf to your computer and use it in GitHub Desktop.
WordPress Function, New Window on Class
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