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

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

Enable Swipe Navigation in the Divi Gallery Lightbox

Enabling swipe navigation in the Divi Gallery module's lightbox allows users to seamlessly browse through gallery images by swiping left or right, creating a more interactive and mobile-friendly experience. This functionality can significantly improve user engagement...

Disable Slide-In Animation for Divi Gallery Grid Images

Control how images appear in your Divi Gallery module by toggling the slide-in animation effect for grid layouts. Disabling the slide-in animation allows gallery images to load instantly and appear statically, providing a faster and distraction-free browsing...

Control Image Count Display in Divi Gallery Lightbox

Displaying or hiding the image count in the Divi Gallery module’s lightbox can help customize the user experience, depending on whether you want to give visitors an indication of gallery progress or prefer a cleaner, distraction-free view. The ability to toggle this...

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...

Random Posts