0

I'm trying to test out instafeed.js and I can't get it to load on a simple bootstrap page

Everything on my page loads, including this container, but it's empty with no hint of Instagram code.

I downloaded the instafeed js folder, in my root directory. The working file is in the same folder as this instafeed folder, and the min.js file is in there.

Obviously, my client ID was omitted, but other than that, what could I be doing wrong here?

Here is my current code block pertaining to this:

<head>
<script type="text/javascript" src="instafeed.js-master/instafeed.min.js"></script>
</head>

<div class="container">
    <div id="instafeed"></div>  
</div>


<script type="text/javascript">
$(document).ready(function() {
  var feed = new Instafeed({
    clientId: 'myclientid',
    limit: '4'
    });
  feed.run();
});
</script>
Geoff_S
  • 4,917
  • 7
  • 43
  • 133
  • Are you trying to view the page locally on your machine from the file system or through a web server? If you are trying to access it through the file system, you might need to add "useHttp: true" to your Instafeed options (source: https://stackoverflow.com/questions/24152544/trouble-with-instafeed-js) – Paurian Jun 08 '18 at 20:16
  • Sorry, should have specified: I am going through a web server – Geoff_S Jun 08 '18 at 20:24

1 Answers1

1

you need to include your access token as well Get your access token from here : http://instagramwordpress.rafsegat.com/docs/get-access-token/

Here is my sample,

if ($instafeed.length) {
            var feed = new Instafeed({
                get: 'user',
                limit: 8,
                userId: userId,
                accessToken: accessToken,
                template: '<a target="_blank" href="{{link}}"><img src="{{image}}" /><div class="instagram-post-stats"><div class="likes">{{likes}}</div><div class="comments">{{comments}}</div></div><i class="fa fa-instagram"></i></a>',
                resolution: 'standard_resolution',
                sortBy: 'most-recent',
            });
        }
            feed.run();
        });
    }
        feed.run();