Twitter feed not showing

resolved (114 posts) (55 voices)

  1. keithmahon
    Member

    Hi,

    Come to work this morning and the twitter feed we have on our front page is now showing:

    'No Twitter Messages'

    There is not been any tweeting for a few days, do you know why this could be and how we can get it working again?

    We are using the code:

    Queens' Twitter - Latest News
    [twitter id="QueensSch" number="3"]

    Posted 1 year ago #
  2. inphasis
    Member

    OK obviously twitter change something in their API setup ... So in /lib/funtions/twitter.php on line 61 change the URL to http://api.twitter.com/1/statuses/user_timeline/ --> This did work for me just fine.

    Posted 1 year ago #
  3. jelvir
    Member

    @inphasis thanks so much! I had the same problem this morning and your solution worked like charm!

    Posted 1 year ago #
  4. richardahlin
    Member

    Thank you inphasis!

    Posted 1 year ago #
  5. danielsami
    Member

    That worked for me too! Thanks inphasis, I think this post should be sticky until the framework or the themes are updated.

    Posted 1 year ago #
  6. danielsami
    Member

    Also, I see that the file /lib/funtions/twitter.php has several urls, should all of them be revised?

    Posted 1 year ago #
  7. keithmahon
    Member

    Thanks!!! Worked!

    Posted 1 year ago #
  8. Elliott
    Support

    @inphasis, The RSS feed that they give you in your settings page changed? I couldn't find any news online about it. Thanks for the update.

    Looks like we'll need to move to JSON soon, https://dev.twitter.com/docs/api/1/get/statuses/user_timeline.

    Posted 1 year ago #
  9. Smiffy350
    Member

    Deleted it started working... Thanks for the the fix

    Posted 1 year ago #
  10. Great and thanks for this.

    I had the same problem and now all sorted :)

    Posted 1 year ago #
  11. Not working for me.

    Could someone please post their complete ".../lib/funtions/twitter.php" file so that I can trying substituting it for mine? I'm using inFocus (don't know if it's different for each theme. Elliott??)

    Posted 1 year ago #
  12. cafesociety
    Member

    thanks for the fix, had read all the old posts and tried all the suggestions, nothing worked until i found this little gem, cheers

    Posted 1 year ago #
  13. Elliott
    Support

    @KEXINO, It's the same for all themes. Open up /wp-content/themes/[your_theme]/lib/functions/twitter.php and change line 51 from this,

    $rss = fetch_feed( 'http://twitter.com/statuses/user_timeline/' . $usernames . '.rss' );

    To this,

    $rss = fetch_feed( 'http://api.twitter.com/1/statuses/user_timeline/' . $usernames . '.rss' );

    And then do the same for line 61.

    Next open up /wp-content/themes/[your_theme]/lib/functions/core.php and change line 168 from this,

    if( strstr( $url, 'twitter.com/statuses/user_timeline' ) )

    To this,

    if( strstr( $url, 'api.twitter.com/1/statuses/user_timeline' ) )

    Posted 1 year ago #
  14. Thanks - that worked. I had changed line 61 but didn't change line 51.

    Posted 1 year ago #
  15. go4itnow
    Member

    Thanks very cool
    Dan

    Posted 1 year ago #
  16. Thanks guys. Been a while since I've needed to come in here, but looks like everything is running smoothly. Excellent fix!

    Posted 1 year ago #
  17. Add me to the list of grateful people for whom your fix saved the day.

    Posted 1 year ago #
  18. YES!!!! Thank you thank you thank you for this fix!!!!

    Posted 1 year ago #
  19. faubelgobble
    Member

    Worked for me. Didn't see that the new line of code from Elliott above isn't complete as it is shown; have to scroll over a bit to the get the whole thing. Was getting errors until I found the whole line.

    Thanks guys.

    Posted 1 year ago #
  20. NICE!!!! had same issue and resolved after reading this thread...

    Posted 1 year ago #
  21. Great :)

    Let us know if you need anything else!

    []'s

    Posted 1 year ago #
  22. Works for me

    Posted 1 year ago #
  23. Another happy customer.

    Posted 1 year ago #
  24. Awesome! :)

    Let us know if you need anything else!

    []'s

    Posted 1 year ago #
  25. kirbyshedd
    Member

    This was great. I'm working on a site with Myriad and then Twitter went bye bye but, thanks to this little fix, all is good again.

    Posted 1 year ago #
  26. USCA
    Member

    Changed both lines on the twitter code but still no tweets. Any ideas? lphs.alpineschools.org and ths.alpineschools.org are two of our sites having problems

    Posted 1 year ago #
  27. lynnewing
    Member

    Thanks, It works for me too.

    @USCA: it takes some times. doesn't work right a way. don't worry

    Posted 1 year ago #
  28. jelvir
    Member

    ok, the change worked a couple days ago but now again I got the "No Twitter Messages" again and I already changed both 51 & 61 any other suggestions?

    Posted 1 year ago #
  29. Elliott
    Support

    @jelvir, perhaps your using up all of your requests. Deactivate any twitter plugins you may have installed. Are you on a shared or dedicated server? There could be someone else on the server using twitter also.

    Posted 1 year ago #
  30. gtchild
    Member

    I have changed the code too and no fix
    Have also tried all other recommendations
    I am using a pro hosting package from 1 and 1 but non of the other sites I have are accessing twitter
    Help!!

    here is my code after changing the two lines - am I missing something?

    function mysite_twitter_feed( $usernames, $limit, $type ) {
    $out = '';

    if( empty( $usernames ) )
    return __( 'Twitter not configured.', MYSITE_TEXTDOMAIN );

    include_once(ABSPATH . WPINC . '/feed.php');
    $rss = fetch_feed( 'http://api.twitter.com/1/statuses/user_timeline/' . $usernames . '.rss' );

    if ( !is_wp_error( $rss ) )
    {
    $maxitems = $rss->get_item_quantity(40);
    $rss_items = $rss->get_items(0, $maxitems);
    }
    else
    {
    add_filter( 'wp_feed_cache_transient_lifetime', 'mysite_twitter_feed_cahce_error');
    $rss = fetch_feed( 'http://api.twitter.com/1/statuses/user_timeline/' . $usernames . '.rss' );
    if ( !is_wp_error( $rss ) )
    {
    $maxitems = $rss->get_item_quantity(40);
    $rss_items = $rss->get_items(0, $maxitems);
    }
    else ........etc.

    Posted 1 year ago #
  31. Elliott
    Support

    Wait an hour and if it's still not displaying then send us a link to your twitter account and your website where your using the shortcode.

    Posted 1 year ago #
  32. VF2F
    Member

    Hi ... i am running Awake 1.3 and can not update due to customization we made but anyway ... here is the twitter code ...

    Would love to get a fix to make the stream work again.

    <?php
    /**
    * Twitter Functions
    *
    */
    if ( !function_exists('relativeTime') ) :

    function relativeTime( $original, $do_more = 0 ) {
    // array of time period chunks
    $chunks = array(
    array(60 * 60 * 24 * 365 , 'year'),
    array(60 * 60 * 24 * 30 , 'month'),
    array(60 * 60 * 24 * 7, 'week'),
    array(60 * 60 * 24 , 'day'),
    array(60 * 60 , 'hour'),
    array(60 , 'minute'),
    );

    $today = time();
    $since = $today - $original;

    for ($i = 0, $j = count($chunks); $i < $j; $i++) {
    $seconds = $chunks[$i][0];
    $name = $chunks[$i][1];

    if (($count = floor($since / $seconds)) != 0)
    break;
    }

    $print = ($count == 1) ? '1 '.$name : "$count {$name}s";

    if ($i + 1 < $j) {
    $seconds2 = $chunks[$i + 1][0];
    $name2 = $chunks[$i + 1][1];

    // add second item if it's greater than 0
    if ( (($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0) && $do_more )
    $print .= ($count2 == 1) ? ', 1 '.$name2 : ", $count2 {$name2}s";
    }
    return $print;
    }
    endif;

    define('MAGPIE_CACHE_ON', 1); //2.7 Cache Bug
    define('MAGPIE_CACHE_AGE', 900);
    define('MAGPIE_INPUT_ENCODING', 'UTF-8');
    define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');

    function parse_cache_twitter_feed($usernames, $limit, $type) {

    include_once(ABSPATH . WPINC . '/rss.php');
    global $shortname;
    $tweet_count = get_option("widget_twitterwidget");
    $count = ($tweet_count) ? $tweet_count : '5';

    $messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$usernames.'.rss');

    if ($usernames == '') {
    $out .= '<p>Twitter not configured.</p>';
    } else {
    if ( empty($messages->items) ) {
    $out .= '<p>No public Twitter messages.</p>';
    } else {
    $i = 0;

    Posted 1 year ago #
  33. Elliott
    Support

    @VF2F, it's this line,

    $messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$usernames.'.rss');

    Just change the URL as seen in the first few posts of this thread.

    Posted 1 year ago #
  34. James_Borrell
    Member

    Hi Elliott,

    This forum is as always very helpful. I have made the changes suggested here, however still can't get it working. Made the changes a couple of days ago, checked I did them as stated here again today, no luck.

    I havn't installed any other plugins recently, and no other Twitter ones. Any ideas?

    Thanks,

    James

    Posted 1 year ago #
  35. jessinsouthafrica
    Member

    I have also made this change and it does not work. Can anyone assist with a full code that does work? I also use an older Awake and never upgraded because the backend is so different and not as user friendly for non-developers.

    Posted 1 year ago #
  36. jessinsouthafrica
    Member

    Ok, I take that back - this DOES work. However, it doesn't work immediately, and I didn't know that. I'm used to seeing Wordpress changes take effect immediately.

    Thank you for the help above, Elliott.

    Posted 1 year ago #
  37. James_Borrell
    Member

    Hi Elliot,

    Sorry, still not luck with getting this working, my site is at http://www.jamesborrell.co.uk using the Elegance theme...

    Cheers,

    James

    Posted 1 year ago #
  38. Elliott
    Support

    Give it some time.

    Posted 1 year ago #
  39. cybertel
    Member

    Hi Elliot,
    I can't find this anywhere,

    /wp-content/themes/construct/lib/functions/twitter.php

    I am searching using in Appearance - Editor using Advanced Code Editor plugin.

    Where should I be looking for line 61?

    Thanks.

    Posted 1 year ago #
  40. Nick02
    Member

    Hi Elliot,

    Same thing here, and unfortunately as a basic level user I'm not sure most of what you're talking about - starting with where do you mean by /wp-content/themes/construct/lib/functions/twitter.php (ie what's the beginning bit of that url?)

    I'm using Echelon, haven't added in any new plug ins recently (this has happened since the Addit plug in issue I asked about before).

    Can you give full instructions for a non-tech person ... I know I'll get confused if I go back through the stream here and try to pick up all the corrections to instructions. Or should I send you the link to my site and Twitter account?

    Thanks

    Posted 1 year ago #
  41. Elliott
    Support

    You have to login to your server using an FTP program such as Filezilla and then download the file,

    /wp-content/themes/[your_theme]/lib/functions/twitter.php

    to your desktop, edit it, save, and then upload it back into the same spot on your server.

    Contact your hosting provider, they usually have a browser based file editor you can use.

    Posted 1 year ago #
  42. cybertel
    Member

    Thanks Elliott, worked a treat. I'm learning all the time, you guys are great.

    Posted 1 year ago #
  43. ammonlee
    Member

    Made the changes, but still no twitter feed.

    So I went and made a shortcode that works from the shortcode generator. It uses the twitter widget js this works like a charm. shortcode looks like this. [twitter_feed username="twitterusername" tweetnumber="5"]
    Here is an example of what it looks like. lphs.alpineschools.org.
    If you want to use it just rename the extension .php and save it to /public_html/wp-content/themes/your-theme/lib/shortcodes

    Attachments

    1. 33-twitterfeed.txt (2.5 KB, 31 downloads) 1 year old
    Posted 1 year ago #
  44. Do not forget to also alter the URL in ../lib/functions/core.php

    function mysite_twitter_feed_cahce( $age, $url ) {
    if( strstr( $url, 'api.twitter.com/1/statuses/user_timeline' ) )
    $age = 900;

    return $age;

    Otherwise the tweets do not update!

    Posted 1 year ago #
  45. Nick02
    Member

    Yep, Elliot, another satisfied customer! Thanks. LEarning all the time.

    Posted 1 year ago #

Reply »

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme