document.addEventListener('DOMContentLoaded', function () {
// Find all grid items with the custom class 'post-has-video'
var gridItems = document.querySelectorAll('.post-has-video');
gridItems.forEach(function (item) {
// Check if the item contains a video element
var video = item.querySelector('video');
var image = item.querySelector('.vc_gitem-zone img');
if (video) {
// If a video is present, hide the image
if (image) {
image.style.display = 'none';
}
video.style.display = 'block';
} else {
// If no video is present, show the image
if (image) {
image.style.display = 'block';
}
}
});
});