WordPress.org

Support

Support » Themes and Templates » Pinboard » [Resolved] How to open links to social media in new window/tab?

[Resolved] How to open links to social media in new window/tab?

  • Hi, I am new to WordPress and like a lot this theme but I can’t make the links for the social media icons in the header open in a new tab or window.

    I also install the plug-in ‘WP Links’, but with no success.

    I think this is important function so people don’t leave your page. I search in forums but with no answer that works for me.

    mariatresgatos.com

Viewing 8 replies - 1 through 8 (of 8 total)
  • paul.a.cunn

    @paulacunngmailcom

    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?

    paul.a.cunn

    @paulacunngmailcom

    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 🙂

    Cheers!

    Thanks again, saludos!!

    Thanks paul.a.cunn@gmail.com, it works like a charm 🙂

    how to get started

    esmi

    @esmi

    Forum Moderator

    @rgarcia83: As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem – despite any similarity in symptoms – is likely to be completely different.

    Worked for me too! Thanks Paul.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] How to open links to social media in new window/tab?’ is closed to new replies.
Skip to toolbar