1

I'm new to WordPress and I'm using the latest version. I am trying to add this library https://github.com/pinceladasdaweb/tweetlight which is getting the latest tweets from Twitter. Tweets should be displayed at the index file. If you're going to look at the files, the necessary files include the request.php at the outside and the api directory. Where should I put them?

I tried putting them inside theme files but no luck.

Thanks!

1

The github repo seems to be a custom code that you need drop into your theme directory, update your config file using your twitter credentials and try putting this code inside the body in any of your intended theme files that you will use(eg, index.php)

<h1>Tweets of a certain user</h1>
<div class="stream">
    <h2><span>Twitter</span></h2>
    <ul class="timeline"></ul>
</div>

<h1>Tweets of a certain user with profile image</h1>
<div class="stream">
    <h2><span>Twitter</span></h2>
    <ul class="timeline-profile-image"></ul>
</div>

<h1>HashTag: #html5</h1>
<div class="stream">
    <h2><span>Twitter</span></h2>
    <ul class="hashtag"></ul>
</div>

<script type="text/javascript" src="../build/tweetlight.min.js"></script>
<script type="text/javascript">
    (function(window, document, undefined) {
        Tweetlight({
            username: 'pinceladasdaweb',
            container: '.timeline',
            counter: 5
        });
        Tweetlight({
            username: 'smashingmag',
            container: '.timeline-profile-image',
            showImageProfile: true,
            counter: 5
        });
        Tweetlight({
            hashtag: '#html5',
            container: '.hashtag',
            counter: 5
        });
    }(window, document));
</script>

I got the code from the example folder of the github repo

  • Hi @Carl, I already inserted the above code in index.php. My question is where should I put the request.php and the api folder? – ajdeguzman Dec 13 '15 at 6:56
  • 1
    You can try putting in the contents of request.php inside the header.php – Carl Alberto Dec 15 '15 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.