- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to make social icons open in a new tab
January 15, 2015
This tutorial will show you how to make social icons open in a new tab in WordPress.
WordPress. How to make social icons open in a new tab
-
Please open your website and look for icons on the top. Click, for example, the first icon google+. You will see this icon is opened in the same tab:
-
In order to open this icon in a new tab, you will need to make some changes in the file. Go to your files (you can use FTP or hosting control panel) and find wp-content\themes\themeXXXXX\static\static-social-networks.php file. Also, you can use WordPress admin panel to edit the file. Log into Dashboard, go to Appearance -> Editor menu, select themeXXXXX – click the file static-social-networks.php. Locate the following line of code:
echo '<li class="'.$social_networks[$i].'"><a href="'.of_get_option($social_networks[$i]).'" title="'.$social_networks[$i].'">
You will need to add this code target=”_blank” at the end, so it will look as follows below:
echo '<li class="'.$social_networks[$i].'"><a href="'.of_get_option($social_networks[$i]).'" title="'.$social_networks[$i].'" target="_blank">
Click Update to save your file:
-
Check your site please. Click on your social icon. You will see the icon is opened in a new tab.
Now you know how to make social icons open in a new tab.
Feel free to check the detailed video tutorial below: