WordPress.org

Ready to get started?Download WordPress

Forums

Jet Pack Twitter Widget : target blank option ? (4 posts)

  1. speedmetalarmy
    Member
    Posted 2 years ago #

    I am running a self hosted site and Jetpack. Set up Twitter widget and it is woking however I want the option to target blank rather than same page for links in the twitter feed. I thought this was an option but don't see any button to select in configuration.

    Really want to use this plugin but without the target blank option I can't; don't want to lose visitiors.

    Any help appreciated.

  2. speedmetalarmy
    Member
    Posted 2 years ago #

    Any word? I need the "target blank" option in order to use the widget

  3. vinuel
    Member
    Posted 2 years ago #

    same problem here ...
    is there a wishlist to put this on?

  4. 82concepts
    Member
    Posted 2 years ago #

    The only way that I found to make them open in new windows is to edit the PHP file.

    It is in "jetpack -> modules -> widgets -> twitter-widget.php"

    On line 151 and line 170 you can add target="_blank" to the links. It doesn't seem to break the code and the links work for me.

    Here's an example on line 151:

    $expanded = '<a href="' . esc_url( $entity_url['expanded_url'] ) . '" target="_blank"> ' . esc_html( $entity_url['display_url'] ) . '</a>';

    Line 170:

    echo "<li>{$before_tweet}{$text}{$before_timesince}<a href=\"" . esc_url( "http://twitter.com/{$account}/statuses/{$tweet_id}" ) . '" class="timesince" target="_blank">' . str_replace( ' ', '&nbsp;', wpcom_time_since( strtotime( $created_at ) ) ) . "&nbsp;ago</a></li>\n";

Topic Closed

This topic has been closed to new replies.

About this Topic