[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

WordPress. How to make social icons open in a new tab

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

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

    screen1_icon_newtab

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

    screen2_icon_newtab

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

WordPress. How to make social icons open in a new tab