WordPress.org

Ready to get started?Download WordPress

Forums

Pinboard
[resolved] How to open links to social media in new window/tab? (9 posts)

  1. mariatresgatos
    Member
    Posted 1 year ago #

    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

  2. paul.a.cunn
    Member
    Posted 1 year ago #

    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>

  3. mariatresgatos
    Member
    Posted 1 year ago #

    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?

  4. paul.a.cunn
    Member
    Posted 1 year ago #

    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!

  5. mariatresgatos
    Member
    Posted 1 year ago #

    Thanks again, saludos!!

  6. Shaink
    Member
    Posted 1 year ago #

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

  7. rgarcia83
    Member
    Posted 11 months ago #

    how to get started

  8. esmi
    Forum Moderator
    Posted 11 months ago #

    @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.

  9. davebuilder
    Member
    Posted 10 months ago #

    Worked for me too! Thanks Paul.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic