Open Entries with Redirection in a New Tab
add_action( 'wp_footer', function() { ?>
( function( $ ) {
'use strict';
$( document ).on( 'ready', function() {
var $entriesWithRedirect = $( '.has-redirect' )
$entriesWithRedirect.each( function() {
var $this = $( this );
$this.find( 'a' ).attr( 'target', '_blank' );
} );
} );
} ( jQuery ) );
<?php } );
All PHP snippets should be added via child theme's functions.php file or via a plugin (we recommend Code Snippets)