Open Divi Slider Button Link in New Tab

Written by Dan Mossop

To make Divi Theme's slider button links open in a new tab, you can add the following into the footer.php file (of the theme itself, or a child theme):

<script>
jQuery(function($){
    $('.et_pb_more_button').attr('target', '_blank');
});
</script>

This is available as an option in Divi Booster. You can find the option on the Divi Booster settings page under "Modules > Slider > Open slider links in new tab".

Check out Divi Booster

Divi Booster upgrades Divi with hundreds of new features to help you build awesome sites with ease. Easily open slider buttons in new tabs without modifying theme files.

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, 

19 Comments

  1. I Love you Dan. Thank you. Worked a treat. For anyone who wants to open other buttons in a new window, simply replace the class. For the pricing table buttons it would be

    jQuery(function($){
    $('.et_pb_pricing_table_button').attr('target', '_blank');
    });

    Reply
    • Thanks, Steve! :)

      Reply
    • Thanks a lot. You save me a hell of a stress.

      Reply
  2. Hi Dan – do you know a way to open any links in a new window?

    Reply
  3. hi dan, i just purchased diviboost because of this config, but I cannot find it anywhere in diviboost. can you pls advise?
    thank you

    Reply
    • Hi Felix, thanks for purchasing the plugin. You'll find the option on the Divi Booster settings page under "Modules > Slider > Open slider links in new tab". Let me know if you still aren't able to spot it.

      Reply
  4. I know this was a while ago, but is there a way to limit just one slide out of many, to open the link in a new window/tab?

    Reply
    • Hi Mark, assuming you just have the one slider module on the page, you should be able to do it by adding a code module (anywhere) on the same page as the slider, then setting its content to:

      <script>jQuery(function($){$('.et_pb_slide_0 .et_pb_more_button').attr('target', '_blank');});>/script>
      

      The "et_pb_slide_0" refers to the first slide. Change to "et_pb_slide_1" for the second slide, "et_pb_slide_2" for the third slide, etc.

      Note that there code should all be placed on one line – no newlines.

      Reply
  5. Or if you only want it to happen on 1 page only just add a full width section add a code element and add the script above ;-)

    Reply
    • Ha! Yes, that's a great solution Tobias :)

      Reply
    • Used a full width section with code element and the code in your post, and it works like a charm! Many thanks!

      Reply
  6. Dan, is there a way to have the button link to an outside website instead of to another page within my current site?

    For example, I want the button to link to http://www.123.com, but when I enter that URL into the "Button URL" field, the button tries to redirect to http://www.MYDOMAIN.com/www.123.com

    Reply
    • Hi Marilee, make sure you enter the URL as "http://www.123.com" rather than "www.123.com". If you don't include the "http" part, it gets treated as a page on the current site.

      Reply
  7. I put the code in the of my site and it works fine. Is there any reason I should not do it this way?

    Reply
    • Hi Charlie, I think WordPress might have stripped part of your comment so I can't tell where you actually put it, but if it's working for you, then there shouldn't be any problem with where you put it.

      Reply
  8. Just did this and it worked like a charm!!! Thank you so much!!!

    Reply
  9. Will this open any of the promo buttons or call to action in a new window?

    Reply
    • Hi Tammy, it's just the slider buttons that it'll open in another window. I'll look into making the other buttons open in another window 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.

Latest From Divi Booster

Fix Divi Text Module "Regular" Font Weight Not Working

Are you encountering an issue where the font weights in Divi's Text Module don't seem to apply as expected? In particular, you might find that when you set the text module's body text font weight to "Regular", your font is actually assigned a weight of 500 instead of...

Make the Divi Gallery Module Swipeable

The Divi Gallery Module comes with a slider mode that lets you display images in a slider with clickable left/right arrows to scroll through the images. For mobile / touchscreen users, you can improve the user experience by allowing your user to swipe to navigate to...

How to Use Divi Dynamic Content in Woo Modules Product Selector

Divi's Dynamic Content is a powerful feature that lets you populate your Divi modules and theme builder templates with data pulled in various sources, such as custom fields. This allows for efficient organization and maintenance of your sites.Unfortunately, Divi's...

Removing Gaps in Divi Builder Layouts

Designing a seamless, professional-looking website is often about managing space effectively. Gaps in Divi Builder - particularly excessive white space between sections, rows, or modules - can disrupt your layout, leading to a fragmented and less engaging user...

Random Divi Posts