The Extra Theme comes with a Featured Posts Module which lets you easily display a selection of posts in a prominent slider. To get to one of the posts, your users normally have to click on the post title, quite a small target. Here’s how to make it so that clicking anywhere on the image of the currently featured post takes them to the post.
First, add the following jQuery code to Extra to make the background featured images into links:
<script>
jQuery(function($){
$('.featured-posts-slider-module .et_pb_slide').click(function(){
var url=$(this).find('h3.entry-title a').attr('href');
if (url) {
document.location = url;
}
});
});
</script>
You can add this to the theme by pasting it into "Extra > Theme Options > Integration > Add code to the head of your blog", after anything else that is in there.
Though not necessary, you might also want to add the following CSS to turn the mouse pointer into a “hand” icon when hovering over the image, to help your users identify the image as a clickable link.
.featured-posts-slider-module .et_pb_slide:hover {
cursor: pointer;
}
.featured-posts-slider-module .et_pb_slide .post-content:hover {
cursor: auto;
}
To add the CSS code to Extra, paste it into Extra's custom CSS box, which you can find from your WordPress admin menu at "Extra > Theme Options > General > Custom CSS". Paste it after any other code already in there. Alternatively, you can place it in the style.css file of your child theme (if using).
This is a great tip and so easy to implement right away. This site is turning into a fantastic resource as I’ve just switched to the Extra theme on my site from DIVI and it takes a bit of getting used to.
Just switched to the Extra theme myself from the Divi builder and this site is proving really helpful – this was bugging me right away, works perfectly – thanks.
Thanks!
Wow, I read a lot of articles from you Divi website and was totally unaware about this website about Extra theme. This post is a lifesaver and ET really should implement this in the theme / category builder. Thanks a lot, I hope to learn a lot more about Extra in your website!
You’re very welcome, Pavak! There are not quite as many articles on this site as there are on Divi Booster, but hopefully you’ll find a few things of use. If there’s anything you’d like to do on either theme but don’t know how to, please ask. Thanks!