Modern Events Calendar - masonry view make image clickable

Hi,

We are using the Modern Events Calendar to display a Masonry View of events filtered by category. We would like to make the image clickable as well as the button and event title.

We tried using the js posted in this thread (which is for grid view), edited for masonry view but it didn’t work.

Can you please advise on best way to achieve this?

Thanks.

Hi @spaghettiweb,

Thank you for reaching out to us. Please add this code instead in the Theme Options > JS:

jQuery(document).ready(function($){
	$('.mec-event-masonry > .mec-masonry-item-wrap').each(function(){
		var link = $(this).find('.mec-event-title > a').attr('href');
		$(this).find('.mec-masonry-img').wrap('<a href="'+ link +'" ></a>')
	});
});

Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Don’t forget to clear all caches including your browser’s cache after adding the code. Hope this helps!

Thanks very much. That works great. I really appreciate your supoort.

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.