How to Make Post Widget’s White Space Clickable (+Popup)

1 year ago

2 min read

Posted by:

Focus

Subscribe to newsletter

By subscribing you agree to with our Privacy Policy.

Share

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: 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.


CODE

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

POPUP

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('.elementor-post').each(function(){
let link = $(this).find('a').attr('href');
$(this).wrapAll( document.createElement( 'a' ) );
$(this).closest('a').attr('href', link);
});
});
});
</script>

BUG

If there is a bug when you set the featured image on the top, put it on the left or right of the title.

Read more

Image

< 1 min read

Crop Image To Ratio

To crop image based on ratio, on Elementor’s Image Widget add this CSS: 16:9 Landscape CSS 9:16 Portrait CSS

Read more

Video

< 1 min read

How to Make Play Icon on Image Overlay Smaller (Elementor Video Playlist Widget)

If you activate the image overlay, there is an option to show play icon. And the default play icon for

Read more

Container

< 1 min read

Make Container Scrollable

Add this on the column’s custom CSS panel. Adjust the ‘max-height’ to your needs.

Read more

Global

< 1 min read

Additional CSS on WordPress Customization

To improve your site a bit, add this basic CSS to each one you create. Customizing the scroll bar, the

Read more

See How It Works

Create better websites, faster.

Download the Entire Library

Adaptative, neutrally designed components.

Customer Service

Focus Website

Today, February 20

Hi, there 👋

How can I help you?

Start Chat with:

We use cookie to improve your experience on our site. By using our site you consent cookies.