
/* Instagram Feed */
/* -------------------------------------------------------------------- */

function mk_instagram() {
    if ($.exists('.mk-instagram-feeds')) {

        $('.mk-instagram-feeds').each(function() {
            var $this = $(this),
                $size = $this.attr('data-size'),
                $sort_by = $this.attr('data-sort'),
                $count = $this.attr('data-count'),
                $userid = parseInt($this.attr('data-userid')),
                $access_token = $this.attr('data-accesstoken'),
                $column = $this.attr('data-column'),
                $id = $this.attr('id');



            var feed = new Instafeed({
                get: "user",
                target: $id,
                resolution: $size,
                sortBy: $sort_by,
                limit: $count,
                userId: $userid,
                accessToken: $access_token,
                template: '<a class="featured-image ' + $column + '-columns" href="{{link}}"><div class="item-holder"><img src="{{image}}" /><div class="hover-overlay"></div></div></a>'
            });
            feed.run();
        });
    }
}