Make Divi Slider Module Image into a Clickable Link

Written by Dan Mossop

Divi includes a slider module that lets you display a slideshow on your pages. Normally, the background of the each slide is not clickable. Here's how to turn your slide backgrounds into a link to a custom URL instead.

Set the Slide "Module Link URL" Option in Divi

Divi now includes a built-in way to set a link on the background of individual slides. You can set it by going into the settings for your slide, and setting your URL at:

Slide Settings > Link > Module Link URL

You can also choose whether or not to open this link in a new tab at:

Slide Settings > Link > Module Link Target

These options are shown below: 

[Deprecated] Set the Background Link URL in Divi Booster

Important: this option had been removed in Divi Booster 3.8.1 as it now possible to achieve this directly in Divi, as described above.

Between Divi Booster v2.3.9 and v3.8.0, there was an option to add a Background Link URL to in the slider module's slide settings. This made the slide background into a clickable link, and turned the cursor into a pointer when the user hovered over the slide background.

When Divi Booster is activated, you'd find the setting in the settings for your slide, as shown:

An additional option that makes the entire slider background trigger a click on the slide button has been available since Divi Booster 2.0.1, under "Modules > Slider". It's still available if you need it.

Set the Background Link using jQuery

If you need to set the slide background link programmatically, the following example jQuery grabs the post URL from the slide button and sends you there when you click anywhere on the slider:

jQuery(function($){
	$('.et_pb_post_slider .et_pb_slide').click(function(){
		var url=$(this).find('.et_pb_more_button').attr('href');
		if (url) {
			document.location = url;
		}
	});
	$('.et_pb_post_slider .et_pb_slide .et_pb_more_button').closest('.et_pb_slide').css('cursor','pointer');
});

A couple of things are worth noting about this example:

  • This will only make the slide background clickable on slides which have a slide button – as it gets the URL to link to from this button. To add a button to a slide, set the Button Text and Button URL in the Slide Settings.
  • Other links in the slider (category, author name, etc) still remain clickable. When the user hovers over these links the pointer will change to a cursor. Everywhere else will, if clicked, lead to the linked URL.

 

Supercharge Your Divi Slider with Custom Links!

Effortlessly turn your Divi slider backgrounds into clickable links using built-in settings. For enhanced customization and a seamless design integration, use WP Magic CTAs to craft tailored call-to-actions for your engaging sliders. Enjoy 50% off until Sept 5!

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

44 Comments

  1. Awesome! A client asked if they could link on the slider, and I just have to enable this option. Thanks Dan!

    Reply
  2. Hi,

    I am using Divi Booster 2.7.2 and the "background link URL" is not showing in the slider setting. it was working before and stopped working. Any idea what is happening?

    Reply
    • fixed!

      Reply
  3. wow, this is a doozy. divi booster works as expected, namely, the background image url for a simple slider with slide background images only. but then we move the site to the host and even though the links are saved in the divi builder, nothing happens on the front end. currently, using Method #2 : Using jQuery – Old Way; https://divibooster.com/make-divi-slider-module-image-into-a-clickable-link/
    that works. any idea why we can't get it to work on the front end?
    live site (doesn't work): http://www.lakesnewsshopper.com
    dev site (works): http://www.blink26.com/test/lakesnewsshopper/

    Reply
    • Hi, the live site is running a newer version of Divi (3.1) which made some changes to the slider HTML which stopped the background image url feature from working. I've just released an update to Divi Booster (2.7.2) which takes these changes into consideration and should fix the issue. I hope that helps, but let me know if not. Cheers!

      Reply
      • yes, that fixed it! thank you very much.

        Reply
  4. Dan – http://chyr.co.uk/VDLCustomer/home-page-3/ – When clicking the learn button the transition to the anchor point is really smooth, when clicking the background image link it's really sharp and doesn't look right. Can we fix this at all?

    Reply
    • Hey David, I've already sent you a reply by email but I'll update here for everyone's benefit. I've added smooth scrolling to the "Background Link URL" option added by Divi Booster to the individual slides (in the slider module options). If the URL is given as a class or id (e.g. ".someclass" or "#someid") the link will now scroll smoothly. It isn't currently compatible with the old option to make all slide backgrounds into links when there is a button, so this option should be disabled – otherwise you just won't get the smooth scroll. I'll try to add smooth scrolling to the old feature too.

      Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.