Snippets: Open all portfolio entry links in a blank tab

// There isn't a function built-in for this for many reasons, but it can be done with javascript like the example below:
function wpex_add_target_blank_to_portfolio_entries() { ?>

	<script>
		( function( $ ) {
			'use strict';
			$(document).ready(function() {
				$('.portfolio-entry a').attr( 'target', '_blank' );
			});
		} ) ( jQuery );
	</script>
	
<?php }
add_action( 'wp_head', 'wpex_add_target_blank_to_portfolio_entries' );
All PHP snippets should be added via a child theme's functions.php file.