The RS Template Builder Archive Posts widget for Elementor allows you to display blog posts, but it does not have an option to make the featured image clickable. By default, only the post title contains a link.
This guide shows two simple ways to add a clickable image.
Method 1: Make Only the Post Image Clickable
This method adds a click event to the featured image and redirects users to the post page.
Add this JavaScript code using an HTML widget or a code snippet plugin:
<script>
window.addEventListener('load', function () {
document.querySelectorAll('.rstb-post-item').forEach(function(post){
const link = post.querySelector('.post-title a');
const thumbnail = post.querySelector('.post-thumbnail');
if(!link || !thumbnail) return;
thumbnail.style.cursor = 'pointer';
thumbnail.addEventListener('click', function(){
window.location.href = link.href;
});
});
});
</script>
Now every featured image in the Archive Posts widget will work as a link.
Method 2: Make the Entire Post Card Clickable
A better user experience is making the whole post card clickable. Users can click the image, title, or excerpt.
Use this JavaScript:
<script>
window.addEventListener('load', function () {
document.querySelectorAll('.rstb-post-item').forEach(function(post){
const link = post.querySelector('.post-title a');
if(!link) return;
post.style.cursor = 'pointer';
post.addEventListener('click', function(e){
if(e.target.closest('a')) {
return;
}
window.location.href = link.href;
});
});
});
</script>
Add this CSS for the correct cursor:
.rstb-post-item {
cursor: pointer;
}
Where to Add the Code
You can add the code in several ways:
- Elementor HTML widget (quick solution)
- WPCode plugin (recommended)
- Theme custom JavaScript section
For a permanent solution, using a code snippet plugin is recommended because your changes will not disappear after theme updates.
After adding the script, the RS Template Builder Archive Posts widget will behave like a modern blog card: the image or the entire post preview becomes clickable.