The Divi theme offers us, as an option, to make appear the social icons at the foot of each page, but how to customize this? How to Open Divi footer icons in a new browser window ? Indeed, the options to display the icons of the Divi footer are basic, this theme does not leave us too many choices: only 4 icons to place at the bottom right and that open in the same tab of the browser! Don't panic, in this article we will see that in two or three clicks, we can change the window opening our links at footer...
1 – Opening of the Divi footer icons: Target concept _Self / Target _Blank
In HTML the tag <a>
allows to add a link to a new web page, whether it is a page of your site or a page of an external site. The syntax is as follows:
<a href="https://astucesdivi.com" target="_blank">Mon blog</a>
The href
being the destination and the target
being the way to get there... That's why there is different values to add to the target attribute – all taken into account by browsers – but we will only keep the main values:
_blank
: opens the link in a new browser window or tab_self
: opens the link in the current window => this is the default
By default, WorPress uses the _self target, maybe without knowing it, you modify this attribute of yourself when you insert a link into the body of your articles. This is exactly what happens when you check the small box below the destination address, look at:
![Add a Target Blank in a WordPress link](https://astucesdivi.com/wp-content/uploads/2018/01/target-blank-icone-footer-divi.jpg)
However, the theme Divi does not offer us such an option when we enter the addresses of our social profiles from the tab Divi > Theme Option > GeneralToo bad.
2 - How to open a new window with the click of an icon in the Divi footer?
If you already use the theme Divi, you must have noticed that icons located in the footer your site or blog did not open in "target blank".
This means that if a visitor to your site clicks on any of the icons located at the bottom of each page, it will leave your site to go to one of your social profiles. This internet user will therefore have left your site and may not return to it, it is the « target self ».
On the other hand, if you had the possibility of him Open your social profiles in a new browser window, maybe this internet user will be tempted to continue reading your article or browsing your site.
To remedy this, it's very simple! You're going to have to add a little bit of code to Divi that will open your social profiles in a new window when internet user clicks on it... Here's this piece of code:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".et-social-icon a").attr('target', '_blank');
});
</script>
3 – Where to insert the code tip to open the Divi footer icons in a new window?
Remember, in one last article, I explained to you that Divi easily enabled code insertion in the "Head" section of your site... So it is precisely here that you will have to add this little script.
Then go to the tab Divi > Theme Options > Integration > Add code line to the Head of your blog
![Code to be inserted to open the Divi footer icons in a new window](https://astucesdivi.com/wp-content/uploads/2018/01/1-icone-target-blank-divi.jpg)
Another solution also: if you prefer to integrate this function into your child theme directly, this is also possible. Simply duplicate the file header.php in your child theme and add this piece of code.
To go further...
The fact open the Divi footer icons in a new window is very important as this facilitates browsing and user experience of your player.
If this one is interested in your article, he may be annoyed if he is forced to return to it by clicking on the arrows « back from one page » his navigator.
Plus, it's super important for your internal statistics : if the reader leaves your site after a few seconds, without even visiting another page, it makes your rebound rate => that's not what you're looking for, is it?
![How to open in target-blank icons placed in the divi footer](https://astucesdivi.com/wp-content/uploads/2018/02/ouvrir-icone-divi-footer.jpg)
29 Comments