Old Twitter Widget

Twitter Widget is enabled, but tweets don’t appear on our site. Please advise.

Twitter changed their API again, so there is no chance to use JSON objects without authentication. However, we made a change on our widget (with embbed timeline) and you can do it on you own if you follow these instructions:

1. open includes/widgets/tbTwitterActivity.php
2. find these lines:

	<div id="twitter_update_list"></div>

        <?php $tweetsNumber = (int)(empty($instance['tweetsNumber']) ? '3' : $instance['tweetsNumber']); ?>
        <?php $twitterID = get_option('tb_twitter_id'); ?>

        <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $twitterID; ?>.json?callback=twitterCallback2&count=<?php echo $tweetsNumber; ?>"></script>

and change them to read:

        <?php $tweetsNumber = (int)(empty($instance['tweetsNumber']) ? '3' : $instance['tweetsNumber']); ?>
        <?php $username = get_option('tb_twitter_id'); ?>

        <a href="https://twitter.com/<?php echo $username; ?>" data-screen-name="<?php echo $username; ?>" data-widget-id="346699208553820160" data-chrome="transparent noborder noheader nofooter noscrollbar" data-tweet-limit="<?php echo $tweetsNumber; ?>">Tweets by @<?php echo $username; ?></a>
		<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

3. open includes/help/tb_enqueue.php
4. find and remove this line:

		if (get_option('tb_twitter_id')) {
			wp_register_script('twitter', TEMPLATE_DIRECTORY . '/js/twitter.js');
			wp_enqueue_script('twitter');
		}

NOTE: above example is for light backgrounds. If you want to use it on darker backgrounds, then put this number 346999722445250560 as your data-widget-id (in above example it is 346699208553820160)

NOTE2: if you want to change color of links, just replace this:

data-tweet-limit="<?php echo $tweetsNumber; ?>"

with

data-tweet-limit="<?php echo $tweetsNumber; ?>" data-link-color="#cc0000"

where you can change hex code (cc0000) to fit your needs.

Please note that with the latest API change Twitter managed to take away control of styling for their timeline and we plan to drop support for this widget in future theme updates. We hope that you will understand this.

0