jQuery(function() { jQuery(".wrap_img-grid").each(function() { var $grid = jQuery(this); var $grid_p = $grid.find(">p")[0]; $grid.find(".wrap_short").each(function() { var $short = jQuery(this); console.log("FOUND SHORT", $short.text()); var shortcode = $short.text(); $short.html('
'); $short.detach().prependTo($grid_p); }); $grid.find(".wrap_pin").each(function() { var $pin = jQuery(this); console.log("FOUND PIN", $pin.text()); var pincode = $pin.text(); $pin.html('
'); $pin.detach().prependTo($grid_p); }); }); });
:is(.wrap_yt-grid,.wrap_youtube-grid,.wrap_img-grid) :is(img, .media) { width: 100%; height: 100%; object-fit: cover; } :is(.wrap_yt-grid,.wrap_youtube-grid,.wrap_img-grid) :is(img, .media) iframe { height: 100%; }