• Resolved pdaniel

    (@pdaniel)


    New to WordPress and PHP so I apologize if this is an easy one. Tried to implement the Kebo twitter into my html document with the following code and I got the below error message:

    <div class=”content-wrap”>
    <?php $tweets = kebo_twitter_get_tweets(); ?>
    <?php $i = 0; ?>
    <?php foreach ($tweets as $tweet) : ?>
    <?php echo $tweet->text; ?>
    <?php if ( ++$i == 10 ) break; ?>
    <?php endforeach; ?>
    </div>

    Warning: Invalid argument supplied for foreach() in D:\Hosting\2780066\html\wp-content\themes\rapscallion\footer.php on line 41

    Any help would be appreciated!
    Thanks.

    https://www.ads-software.com/plugins/kebo-twitter-feed/

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter pdaniel

    (@pdaniel)

    Ok, I’ll give it a shot. For kicks I plugged in the following code and the else part came back which tells me the data coming back is not in array form maybe?? I checked again with the $tweets = kebo_twitter_get_tweets();
    print_r($tweets);

    and the tweets are coming back ok. I see them fine.

    code:
    <?php $tweets = kebo_twitter_get_tweets(); ?>

    <?php $i = 0; ?>

    <?php if (is_array($tweets)) : ?>

    <?php foreach ($tweets as $tweet) : ?>

    <?php echo $tweet->text; ?>

    <?php if (++$i == 10) break; ?>

    <?php endforeach; ?>

    <?php else : ?>

    <p>Sorry, no Tweets found.</p>

    <?php endif; ?>

    Plugin Author Peter Booker

    (@peterbooker)

    Hi pdaniel,

    Thanks for coming back to us. The other problems like this have been character encoding issues and the data gets cut off at the bad character, so that when it comes to using it, it is not decoded properly and is not a properly formed array.

    If you can install the above version of the plugin I mentioned above, it will let me see the data directly and I can see if it is the above problem or if there is another issue we need to fix.

    I really appreciate you taking the time to help us debug this issue, it really helps us to improve the plugin, thanks again!

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Error with PHP?’ is closed to new replies.