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

9 months 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

Troubleshoot

< 1 min read

How to Fix Custom Fields Not Showing in WordPress (Crash with ACF Plugin)

If custom field is not showing when ACF plugin is activated, go to Dashboard > Themes > Themes File Editor,

Read more

Container

< 1 min read

Hide Scroll Bar On ‘Overflow: Auto’ Container

Add this following CSS code to the container: selector {-ms-overflow-style: none; /* IE and Edge / scrollbar-width: none; / Firefox

Read more

Video

< 1 min read

How to Get Youtube API and Check Quotas

How to get Youtube API:Go to: https://console.cloud.google.com/apis/dashboard How to check Youtube API Quota:Go to: https://console.cloud.google.com/iam-admin/quotas

Read more

Global

2 min read

WordPress Auto-Translate Plugin and How to Disable Google Pop-ups

This plugin helps you translate your website into 104 different languages ​​in just seconds. Simply by installing and activating this plugin,

Read more

See How It Works

Create better websites, faster.

Download the Entire Library

Adaptative, neutrally designed components.

Customer Service

Focus Website

Today, July 27

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.