Quantcast
Channel: Site5 Free Premium WordPress Themes » All Posts
Viewing all articles
Browse latest Browse all 8865

Reply To: Twitter Footer Feed Not Working

$
0
0

Friends, get it to work!!

The twitter a few days brings changed its API, leaving millions of websites without running your feeds, so I decided to study some new API along with a few tutorials I’ve seen on the web can get to these codes, I’ll try to make it as simple as possible for not too much hassle.
01 – First we download these files containing the new twitter API and save to our WordPress theme, no need to move these files because they are already configured. Click here

02 – Once you have downloaded the files we copy the code below and color where you want to list your tweets, pay close attention because the variables before taking a f5 and see if it will work follow the link to create an application on your twitter account dev.twitter.com/apps/

03 – Now you must go to your site/blog wordpress and do the following.

Appearance -> Editor -> footer.php

Below the line 104 (<div id=”twitter”>), paste this code and make the necessary changes:

<?php
require_once(‘twitteroauth.php’); //Path to twitteroauth library

$twitteruser = “xxxxx”; //Put here your twitter username
$notweets = x; // Here is the number of tweets you want listed
$consumerkey = “xxxxxxxxxxxx”; //Put here your consumer key
$consumersecret = “xxxxxxxxxxx”; // Put here your secret consumer
$accesstoken = “xxxxxxxxxx”; // Put here your token
$accesstokensecret = “xxxxxxxxxxxx”; //Put here your token secret

function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}

$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);

$tweets = $connection->get(“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=&quot;.$twitteruser.”&count=”.$notweets);
?>

Below the div (<div id=”twitter_update_list”> </ div>) paste the following code:

<?php echo $tweets[0]->text; ?>

04 – Once you have created your application on twitter, you must change the variables $ consumerkey, consumersecret $, $ accesstoken, $ accesstokensecret
copying and pasting the code provided by twitter, this way you are allowing access to your feeds.

05 – Ready now be running.

I tried this way and it does not work, I get error


Viewing all articles
Browse latest Browse all 8865

Trending Articles