Ok so this involves editing a php file of the theme. However, since it is such a small change I think in this case it is ok. Go to “appearance” then “editor” in the top right select “Pinboard” from the drop down menu. Then select the “Sidebar-header.php” file. This is where the theme tells the social media icon links how to behave. Find the following code for each of the links. Below is just an example for the twitter link.
<a class="social-media-icon twitter" href="<?php echo esc_url( pinboard_get_option( 'twitter_link' ) ); ?>" >Twitter</a>
Just add target=”_blank” before the end of the
<a>tag as done below.
<a class="social-media-icon twitter" href="<?php echo esc_url( pinboard_get_option( 'twitter_link' ) ); ?>" target="_blank">Twitter</a>
wow! thanks very much for your time and clear explanation. 🙂
One thing… I created a child theme with some changes to style.css, should I copy this Sidebar-header.php file in the new folder on the server as well?
Yes you should because as with all the php files they will change to when the theme is updated. Since this is such an easy fix and will not hurt your site when you do update the theme its your call if you want to just redo this when the theme is updated. Make sure to mark this issue as resolved 🙂
- The topic ‘How to open links to social media in new window/tab?’ is closed to new replies.