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

Enable Automatic Looping for YouTube Videos in the Divi Video Module

Enabling automatic looping for YouTube videos in your Divi video module ensures that content plays seamlessly and continuously without interruption. This feature can enhance user engagement, highlight key information, or create dynamic visual effects on your website....

Hide Video Controls in Divi Video Module

Disabling YouTube video controls in the Divi Video Module helps create a seamless, distraction-free viewing experience for your site visitors. This approach is useful when you want full control over how your video content appears and is interacted with on the page, or...

Mute YouTube Videos by Default in the Divi Video Module

In the Divi Video Module, starting your YouTube videos muted by default can create a more user-friendly browsing experience on your webpage. It is particularly beneficial for reducing distractions, enhancing visitor engagement, and providing a seamless content preview...

Autoplay Videos in Divi Video Module

Enabling videos in your Divi video module to start playing automatically can enhance both the site's design and user engagement. To ensure full compatibility with browser requirements, such as Chrome's autoplay policy, it's often necessary to start your videos muted...

How to Add the Post Status in Divi's Dynamic Content

Divi's Dynamic Content feature is great for enhancing your post/page templates with post-specific information. While Divi includes an option to show information such as the Post Created Date using Dynamic Content, there is no equivalent option for the Post Status....

Random Divi Posts