How to Make Divi Social Icons Open in a New Tab

by | Last Updated: Jun 9, 2016 | Blog, Divi theme

Today I decided to write a little about an issue that I often see people asking questions in the Divi Facebook groups on which I’m active. The question is: “How to make the social icons open in a new window?” So here’s the solution:

 

Social Icons Open New Tab

 

There are more ways to do this. You could do that with a JavaScript code, but I prefer to use some custom HTML code for this. So just open the file social_icons.php that’s located in the Divi’s “includes” folder. Add the code target=”_blank” to the links that you want to open in a new window. Here’s an example of how the Twitter link will look like:

<a href=”<?php echo esc_url( et_get_option( ‘divi_twitter_url’, ‘#’ ) ); ?>” class=”icon” target=”_blank”>

However, do not save this file to its default location. Save it to your Divi child theme folder (if you don’t have a child theme yet, check this article) and don’t forget to keep the same directory path – so you’ll need to create the “includes” folder in your child theme’s main folder and then place the social_icons.php file into it.

That’s all from me for now. Hope I have helped some of you. :)

Bloom Email Opt In Plugin

Disclosure: This website is not owned by Elegant Themes. Some of the links on this website are affiliate links. That means that I will get paid a commission if you use them. This however does not influence my opinions, as I'm personally using these products and am satisfied with them.
Share This