How to Make the Whole Divi Blurb Module Clickable

aniaromanska

Written by Ania Romańska

Published on . Last edited on .

Clickable Blurb module in Divi

TL;DR

The Blurb's Title Link URL (Content → Link) makes only the image or icon and the title clickable, not the description.

Content → Link → Module Link URL makes the whole Blurb clickable without code, in Divi 5 and Divi 4; Module Link Target opens it in a new tab.

Divi opens the module link with JavaScript (the module gets the class et_clickable), so keep the Title Link URL filled in for keyboard users.

The jQuery alternative: add the class blurb_click (or blurb_click_newtab for a new tab) and the script sends a click anywhere in the Blurb to the first link inside it.

The jQuery code goes into Divi → Theme Options → Integration → Add code to the < body >; it works in Divi 5 because it is wrapped in jQuery(document).ready().

Updated for Divi 5: You don't need any code to make a whole Blurb clickable anymore: the Module Link URL setting does it, and I tested it in Divi 5.18. The same setting exists in Divi 4. The original jQuery method still works in Divi 5 too, so I kept it below for anyone who prefers it.

How does the Blurb Module link work?

The Title Link URL in the Blurb settings (Content → Link) links only the image or icon and the title, not the whole Blurb. The description and the empty space around it are not clickable.

You can see it on the demo page I've set up.

Divi Blurb where only the icon and the title are clickable

But I like my blurbs to be clickable as a whole. So how can we do it?

How to make the whole Blurb clickable in Divi 5 (no code)

Fill in the Module Link URL field in the Blurb settings: Content → Link → Module Link URL. Divi then makes the entire Blurb clickable, including the description and the padding, and Module Link Target lets you open the link in a new tab.

  1. Open the Blurb settings and go to Content → Link.
  2. Paste your link into Module Link URL.
  3. If the link should open in a new tab, change Module Link Target.
  4. Keep the same URL in Title Link URL too, so the title and the rest of the Blurb lead to the same page.

In my Divi 5 test, a click on the description opened the Module Link URL and the mouse cursor turned into a hand over the whole Blurb, without any extra CSS. The same fields are in Divi 4 (Content → Link).

One thing to know: Divi opens the module link with JavaScript, so it isn't a real link that keyboard users can tab to. That's another good reason to keep the Title Link URL filled in.

How to make the Blurb clickable with jQuery

If you prefer code, for example because many of your Blurbs already have a Title Link URL, a few lines of jQuery can make the whole Blurb follow the link that is already inside it. This is the original method from this post, and it still works in Divi 5.

We don't want all the blurbs to behave this way, so we need to add a custom class, which we can then target with JavaScript. Let's add a custom class blurb_click to the Blurb module. In Divi 5: Advanced → Attributes → Add Attribute → CSS Class; in Divi 4: Advanced → CSS ID & Classes.

Then we need this piece of code:

<script type="text/javascript">
jQuery(document).ready(function($) {
	$(".blurb_click").click(function() {
		window.location = $(this).find("a").attr("href"); 
		return false;
	});
});
</script>

Add this code to the <body> in Divi → Theme Options → Integration (turn on "Enable body code" and paste it into "Add code to the < body >").

Divi Theme Options Integration tab with body code enabled

In Divi 5, jQuery is loaded in the footer by default. The code still works, because it is wrapped in jQuery(document).ready(): Divi runs it once jQuery has loaded. You can read more about this in my guide on how to add JavaScript and jQuery code to Divi.

Opening the link in a new tab

If you want your links to open in a separate tab, just change the class to blurb_click_newtab and use the code below:

<script type="text/javascript">
jQuery(document).ready(function($) {
	$(".blurb_click_newtab").click(function() {
		 var blurbLink = $(this).find("a");
		 blurbLink.attr("target", "_blank");
		 window.open(blurbLink.attr("href"));
		 return false;
	});
});
</script>

The script we've added basically just looks for a link inside the Blurb and applies that link's href attribute to the click function. It's better not to have any other links in the description field of the Blurb Module, because the script uses the first link it finds.

Show the hand cursor

You'll probably want the hand cursor to appear when the mouse hovers over the blurb. To do this, add this bit of CSS (Divi → Theme Options → General → Custom CSS):

.blurb_click:hover {cursor: pointer;}

See demo page »

This article has been tagged with: Divi 5, JavaScript

Tags

Clickable Blurb module in Divi

Table of Contents

Popular questions

How do I make the entire Blurb clickable in Divi 5?

Open the Blurb settings, go to Content → Link and paste your link into Module Link URL. The whole module becomes clickable, and Module Link Target lets you open it in a new tab. No CSS or JavaScript needed.

Why is only the title and icon of my Blurb clickable?

The Title Link URL field wraps only the image or icon and the title in a link. To make the description and the rest of the Blurb clickable, use Module Link URL instead (or as well).

Does the old blurb_click jQuery code work in Divi 5?

Yes. I tested it in Divi 5.18. Divi 5 loads jQuery in the footer, but the code is wrapped in jQuery(document).ready(), so it runs once jQuery is ready. In Divi 5 you add the blurb_click class in Advanced → Attributes.

Can I open a clickable Blurb in a new tab?

Yes. With the setting, change Module Link Target in Content → Link. With the jQuery method, use the class blurb_click_newtab and the second script from this post.

About the Author

Ania Romańska

I'm a Divi expert from Poland, with over 10 years building the templates and courses that make up Divi Lover. I'm also a mom of five, which taught me a thing or two about explaining things clearly the first time.

Hey there!Sorry to interrupt,but this one's important!

Divi Lover is turning 10!
Let’s celebrate with 40% off everything.

Ten years of Divi templates, plugins and tips, and a brand-new website to celebrate it. To say thank you, every product in the shop is 40% off until Cyber Monday.

Your code

Paste it at checkout. Valid until November 30.