How to Open YARPP Links in a New Window?


If you’re comfortable with a bit of jQuery/JavaScript, for the thumbnail theme - add the following code to open YARPP links in a new window:

jQuery version:

jQuery(document).ready(function($) {
 $(".yarpp-thumbnail").attr("target", "_blank");

Vanilla JavaScript version:

document.addEventListener('DOMContentLoaded', function() {
  var yarpp_els = document.querySelectorAll('.yarpp-thumbnail');
  for (var i=0; i < yarpp_els.length; i++) {
    yarpp_els[i].setAttribute('target', '_blank');