WordPress.org

Ready to get started?Download WordPress

Forums

Latest Tweets Widget
[resolved] shortcode? (8 posts)

  1. lamarant
    Member
    Posted 9 months ago #

    Great work. Does this plugin have a way to only show the latest tweet, perhaps via a short code? I'd like to just display my latest tweet in my sites header rather than a list in a sidebar.

    http://wordpress.org/extend/plugins/latest-tweets-widget/

  2. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    shortcode is a good idea. Not supported yet. I will add when I get a moment

  3. lamarant
    Member
    Posted 9 months ago #

    Thanks. I'll check back periodically but can you post here when you've implemented the shortcode? I'll be your guinea pig. Appreciate it!

  4. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    I've added a [tweets] shortcode to the development version 1.0.10

    You can specify a couple of attributes too:
    [tweets max=5 user=timwhitlock]

    Let me know how you get on and I'll publish it to the stable branch at some point.

  5. lamarant
    Member
    Posted 9 months ago #

    I can't seem to find the 1.0.10 version? Only goes up to .09

  6. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    Sorry, yes. I incremented the version number in the wrong file.
    Try again: http://wordpress.org/plugins/latest-tweets-widget/developers/

  7. lamarant
    Member
    Posted 9 months ago #

    Very close. All I need is the text of the last tweet. But I ended up using your existing code to create my own short code: [tweet user=lamarant], which calls a modified function:

    function last_tweet_text( $screen_name = '' ){
    $items = latest_tweets_render( $screen_name, 1, false, false );
    return $items[0];
    }

    That returns the last tweet and date stamp in <p> elements. I remove the date <p> using css (display: none) and voila.

    http://www.leonamarant.com/

    It would be cool if your plugin could include a web service that returned the raw JSON from the users Twitter feed (like the old API). That way you could call the service (using jQuery.ajax() for example) and do whatever you wanted with the data. I think this could be done using the wp_ajax method but I'm not 100% sure (it's been a while).

    In any case...great work on this plugin. I was worried that I was going to have to create this myself! Thanks again.

  8. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    Glad it got you there.

    re Ajax. Opening up Twitter data in this form on your site is likely to get you shut down by Twitter. Even if it's only your feed, it's against their oppressive API terms of use. For reference: http://twproxy.eu/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.