document.addEventListener('DOMContentLoaded', function() { const items = document.querySelectorAll('.publication-item'); items.forEach(item => { const url = item.textContent.trim(); // get the URL from the div if(url){ item.addEventListener('click', function(e){ e.preventDefault(); // stop the default post page link e.stopPropagation(); // stop outer click window.location.href = url; // redirect to external URL }); } }); }); Skip to main content