WordPress.org

Ready to get started?Download WordPress

Forums

Display Tweets
[resolved] No links to feed or individual tweets? (10 posts)

  1. rchrisbishop
    Member
    Posted 1 year ago #

    I notice links posted within the tweets show up, but not links to the tweet itself (usually embedded in the time stamp) or the general feed. Is there a way to activate these links?

    http://wordpress.org/extend/plugins/display-tweets-php/

  2. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @rchrisbishop, I'll definitely have a look at this for you when working on the next update. Might be able to add it.

    Unfortunately not a feature at the moment. Very sorry about that.

  3. rchrisbishop
    Member
    Posted 1 year ago #

    I look forward to it, thanks

  4. Maligno
    Member
    Posted 1 year ago #

    link to tweets should be:

    https://twitter.com/SCREEN_NAME/status/ID_STR

    so, you will need to add (for getting de screen name):
    $settings = $this->validate_settings( get_option( 'displaytweets_settings' ) );

    inside the show() function and then use this for link:

    https://twitter.com/'.$settings['screen_name'].'/status/'.$this->format_tweet($tweet->id_str)

    $tweet->id_str has the tweet id

    Example:

    echo '<p>{$this->format_tweet( $tweet->text )}<br /><small class="muted"><a href="https://twitter.com/'.$settings['screen_name'].'/status/'.$this->format_tweet($tweet->id_str).'">- {$posted_since}</a></small></p>';

  5. rchrisbishop
    Member
    Posted 1 year ago #

    I tried this and received

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /data/23/2/34/80/2197080/user/2412808/htdocs/wp-content/plugins/display-tweets-php/displaytweets.php on line 590

    Is there another step besides replacing
    echo "<p>{$this->format_tweet( $tweet->text )}<br /><small class=\"muted\">- {$posted_since} ago</small></p>";

    with

    echo '<p>{$this->format_tweet( $tweet->text )}<br /><small class="muted"><a href="https://twitter.com/'.$settings['screen_name'].'/status/'.$this->format_tweet($tweet->id_str).'">- {$posted_since}</a></small></p>';

  6. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hey again. I'm uploading v1.0.3 of Display Tweets as I'm writing this, so give it a try and see if it does a better job.

    I've included a new WordPress filter which will link the tweet's date to the tweet itself. To enable this filter, add the following code to your theme's functions.php file.

    add_filter( 'displaytweets_link_date_to_tweet', '__return_true' );

    That should do the trick :)

  7. rchrisbishop
    Member
    Posted 1 year ago #

    This works great. One more question - how would I get this to open a new window to the Tweet?

    target="_blank" doesn't seem to work on the displaytweets.php page.

  8. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Target blank should work, depending on how your browser handles it.

  9. rchrisbishop
    Member
    Posted 1 year ago #

    I got it to work, thanks.

    I had to use target=\"_blank\"

  10. jrennard3
    Member
    Posted 8 months ago #

    Hey Matthew - I like the idea of the plugin and it displays my latest tweet perfectly, however the links to the @names don't work. They are a different color, but they don't hover and they don't link.

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic