Hello, just an update, I moved the Kona block I’ve been testing to this URL for now, still seeing same behavior as originally described:
https://ww2.green-wood.com/kona-test/
Thanks for looking into this!
Hi there,
I’ve figured out why this is happening by looking at the code repo for this plugin and the Instagram API reference. The short version is that the developer’s old way of specifying the number of images was set up to only request your chosen number from Instagram. But IG changed the API and now you can only retrieve them in batches of 25. The dev has not yet updated the code in the plugin to discard the excess images after they’re retrieved.
I figured out a way to do it, but it requires editing the code inside this actual plugin, which means if you make this change, it’ll get erased next time the plugin is updated. (though hopefully the plugin devs will fix the bug in the meantime!). I haven’t done lots of testing, but I got it to work on one site. If you want to risk it:
- Find the file
server.php inside the plugin’s src directory
- go to line 161. It should currently read
foreach($thumbs as $thumb) {
- Delete the line and replace it with the following:
foreach (array_slice($thumbs, 0, $numberImages) as $thumb) {
- Save the file and reload a page on your site that uses the block
Once again, only do this if you’re comfortable editing files on your site. I’m not responsible for outages or data loss etc. etc. And remember, this edit will disappear if you update the plugin!
Thanks so much! I made that change and it worked. I’m going to keep testing and go from there, maybe see if the developer chimes in here about the solution and the browser compatibility CSS I mentioned in my initial post. I’ve also been noticing that this plugin gets flagged by GTMetrix, Pingdom etc for not serving scaled images, wondering if there’s an alternative solution for that.
Thank you @yonatron for your help! Bingo ill update the plugin today.
Also thank you @colinmcd3 for noticing. Sometimes I cant believe this little thing I made is being used all around the world.
v1.7 will fix this and merge @yonatron’s code.
In terms of browser compat, @colinmcd3 if I was to release this as an addon, would it be something you would consider purchasing?
Glad to help @gubbigubbi and yes, our Brooklyn NY nonprofit is a big fan of your work! I’d definitely consider purchasing the add-on for browser compatibility, and even more so if it also addressed what I mentioned about the plugin getting flagged by GTMetrix, Pingdom etc for not serving scaled images. Just let me know if I can do anything else to help, and I’ll be following along…
@colinmcd3 – sounds good thank you for your help! Also thank you @yonatron.
Ill let you know when I have a release ready 🙂
I have a few things I need to do first such as our own API key method (not using a 3rd party).
Glad I was able to help! It took me a while to figure out how to make myself a new Access Token now that ig has changed the Basic Display stuff so much. So I imagine you have your hands full trying to fix that. Will be on the lookout for updates!
Hey @yonatron could you please PM me on twitter, I would love your help. Im looking to develop a premium version of this plugin and you could be a partner?
My twitter thingy is @RhysClay
@gubbigubbi, I don’t mean to derail the thread, but I couldn’t DM you on Twitter so I sent a public reply. Don’t know if you saw it, but if you still want to talk, my handle is @yonatron on Twitter and on the Making WordPress slack.