Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter - excluding by ID #117

Closed
wreeecks opened this issue May 26, 2014 · 2 comments
Closed

Filter - excluding by ID #117

wreeecks opened this issue May 26, 2014 · 2 comments

Comments

@wreeecks
Copy link

Hi,

How do I properly exclude a post by filtering its ID?

I tried doing this using the code below, it was successful in filtering the images but the excluded images were not replaced with a post. For example, the limit is set to 12 after applying the filter which excluded 2 posts. it returned only 10 items in the list. I was expecting to have a total of 12 items.

I think this is happening because the filter is applied after the API request . Is there any way to filter before the API request? Thanks!

         var feed = new Instafeed({
            get: 'tagged',
            tagName: 'love',
            limit: 12 ,
            clientId: '111111111',
            template: ' <li class="col-lg-2 col-md-2 col-sm-2 col-xs-4"><img src="{{image}}" /></li>',
            filter: function(image) {
                if(image.id  != "POST_ID" ) {
                    return true;
                }else{
                    return false;
                }
              }
        });
        feed.run();

@JimmyRittenborg
Copy link

I'm fiddling with the same problem too #97 (comment) have some good suggestions, but it'll leave some images out completely 😞

@benjamin-hull
Copy link
Collaborator

Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants