Elementor Extra: Post Widget All Space / Whole Card or Box Clickable (+Popup)

Go to Dashboard > Elementor > Custom Code. And then add this code to make the whole space/box/card of the post widget to be clickable.

Note 1: The header, footer and extra area on the body padding bottom is not clickable. There’s a known bug on mansory style as well.

Note 2: It does not work on new posts that has been generated by ‘Load More’ or ‘Infinity Scroll’ pagination.

IMPORTANT
You have to set the post CSS Classes to post. But if you forgot and it works just fine, then it’s fine.

				
					<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($){
$('.post').find('.ee-post__body').each(function(){
let link = $(this).find('a').attr('href');
$(this).wrapAll( document.createElement( 'a' ) );
$(this).closest('a').attr('href', link);
});
});
});
</script>
				
			

If you want the whole box to be clickable on popup as well, add this to Elementor Custom Code as well.

				
					<script>
jQuery( document ).on( 'elementor/popup/show' , function () {
	jQuery(function($){
$('.post').find('.ee-post__body').each(function(){
let link = $(this).find('a').attr('href');
$(this).wrapAll( document.createElement( 'a' ) );
$(this).closest('a').attr('href', link);
});
});
});
</script>																														 
				
			

The whole box, including the excerpt is clickable. But in this case, all example posts are linked to the main site.

  • Video ·

YotuWP: Custom CSS

DESCRIPTION Go to Dashboard > Appearance > Customize and add this custom CSS. CODE DARK…