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 Posts

Hide Gallery Image Titles in the Divi Lightbox Overlay

Displaying image titles in the lightbox overlay of the Divi Gallery module can sometimes be distracting or unnecessary, depending on your website’s design and user experience goals. Hiding these titles creates a cleaner and more focused viewing experience for visitors...

Customize Divi Gallery Module Pagination with Custom Text and Icons

Enhancing the navigation experience in your Divi Gallery module can make your galleries more intuitive and visually appealing for visitors. By replacing the default previous and next pagination links with your own text and icons, you can better align the gallery...

Set a Custom Counter Duration in the Divi Number Counter Module

Adjusting the duration of the number animation in the Divi Number Counter module allows you to control the speed at which numbers count up, providing a smoother or more dramatic effect to suit your design preferences. This feature helps you better capture user...

Replace Pagination Numbers with Icons in Divi Gallery Module

Transforming the pagination in the Divi Gallery module by replacing default page numbers with an icon creates a modern, visually appealing navigation experience for gallery viewers. This customization can enhance site aesthetics and improve accessibility by providing...

Change Divi Gallery Module Slider Arrow Size

Adjusting the size of slider arrows in the Divi Gallery module can help improve site navigation, enhance visual consistency, or better match your site’s design preferences. Whether you want to make navigation elements more prominent or integrate them seamlessly with...

Random Posts