Title: Limit image number
Last modified: August 21, 2016

---

# Limit image number

 *  Resolved [jamesn81](https://wordpress.org/support/users/jamesn81/)
 * (@jamesn81)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/)
 * Hi there,
 * I’m using
 * `[si_feed link=false width=160 limit=24]`
 * On my site .. but the number limit of 24 isn’t being adhered to.
 * Any advice?
 * Thanks!
 * [http://wordpress.org/plugins/simple-instagram/](http://wordpress.org/plugins/simple-instagram/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [mr_speer](https://wordpress.org/support/users/mr_speer/)
 * (@mr_speer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4508986)
 * Hello!
 * The good news is, I just tried your shortcode and was able to get it to respect
   the limit, so hopefully we should be able to resolve this. Could you give me 
   a little more info?
 * – Is it showing more or less than 24 images?
    – If it’s showing less than 24 
   images, can you verify that your account has at least 24 images to show? – If
   you define another user, does it adhere to the 24 limit?
 * Let me know and we’ll try get to the bottom of this!
 * Thanks!
 * mr_speer
 *  Thread Starter [jamesn81](https://wordpress.org/support/users/jamesn81/)
 * (@jamesn81)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509016)
 * Sorry, I left out that I’m also using a **tag** in the code. I pasted an earlier
   version of it from my clipboard.
 * Let’s say it’s “hipster”
 * `[si_feed link=false tag=hipster width=160 limit=24]`
 * I can see more than 24 images … the tag has more than 24 images.
 * Hope that helps!
 *  Plugin Author [mr_speer](https://wordpress.org/support/users/mr_speer/)
 * (@mr_speer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509030)
 * Thanks for the further information! I’m having a hard time replicating the problem
   in my environment; I used the tag as posted and it is displaying the proper amount
   of images.
 * It could perhaps be a difference in our dev environments. Could you possibly 
   post a link to a demo page that shows the issue? That might help me troubleshoot
   further.
 * Thanks for your patience! Hopefully we can get everything sorted.
 * Thanks!
 * mr_speer
 *  Thread Starter [jamesn81](https://wordpress.org/support/users/jamesn81/)
 * (@jamesn81)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509038)
 * Ok sure – the Instagram gallery should be appearing here:
 * [http://www.jamesnorthproductions.com.au/#gallery](http://www.jamesnorthproductions.com.au/#gallery)
 * It’s showing 30 images at the moment (that’s how many are in my tag of jnpstudio)
 * I’ve set the limit at 24 and it’s not adhering to it.
 * My code pasted from my page is:
 * `[si_feed link=false tag=jnpstudio width=160 limit=24]`
 * The user is james_north
 *  Plugin Author [mr_speer](https://wordpress.org/support/users/mr_speer/)
 * (@mr_speer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509045)
 * Great news! I was able to locate the issue.
 * From what I can tell, this is an issue on Instagram’s end. For some reason, the
   limit isn’t always respected for tag queries. I’ve found posts of other people
   reporting the same issue, so it seems pretty well documented as a bug.
 * The good news is that I’ve created a little fix for it that should suffice for
   the time being. If you’re comfortable with doing a simple edit to the plugin 
   yourself, you can edit the file at includes->simple-instagram-shortcodes.php.
   Paste the following code at line 22:
 *     ```
       if(count($feed->data) > $limit){
       	 $total = count($feed->data);
       	 $diff = $total - $limit;
       	$start = $total - $diff;
       	for($i=$start; $i <= $total; $i++){
       		unset($feed->data[$i]);
       	}
       }
       ```
   
 * It’ll go after the line `if(($feed) && count($feed->data) > 0){` and before the
   line `$return = '<div class="si_feed">';`
 * Otherwise I’ll be pushing a new version with this fix included here shortly, 
   so you can update instead.
 * Thanks for your help in getting this nailed down!
 * mr_speer
 *  Plugin Author [mr_speer](https://wordpress.org/support/users/mr_speer/)
 * (@mr_speer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509046)
 * The new version has been pushed, so if you update to version 1.1.1, you should
   be good to go. Let me know if this resolves it for you!
 * mr_speer
 *  Thread Starter [jamesn81](https://wordpress.org/support/users/jamesn81/)
 * (@jamesn81)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509053)
 * Perfect – all working.
 * Thanks for checking it out!
 *  Thread Starter [jamesn81](https://wordpress.org/support/users/jamesn81/)
 * (@jamesn81)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509054)
 * Oh I also meant to check about the order of tagged images 🙂
 * Currently the oldest photo is appearing at the top of the stream.
 * I wonder if they’re sorted by date, or age of tag? The reason being, I created
   a unique tag for the content, and went through the pictures I wanted tagged from
   newest to oldest and tagged them. So theoretically, the tag is oldest on the 
   newest photo (scrolling down through the images).
 * Can it be reversed, and is this problem also unique to tags?
 *  Plugin Author [mr_speer](https://wordpress.org/support/users/mr_speer/)
 * (@mr_speer)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509059)
 * Great! I’m glad that it all worked out for you.
 * As far as the order of photos, here’s a quote directly from Instagram regarding
   the tag option:
 * > …Get a list of recently tagged media. Note that this media is ordered by when
   > the media was tagged with this tag, rather than the order it was posted.
 * So it looks like that’s the order in which it is displayed.
 * I’ll note the issue as a possible feature request for future versions, but for
   now since you reported the originally issued as solved I’m going to mark this
   thread as resolved.
 * Thanks!
 * mr_speer
 *  [MarieSvendsen](https://wordpress.org/support/users/mariesvendsen/)
 * (@mariesvendsen)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509129)
 * The fix didn’t solve my problem.
    I want the feed to be unlimited and have set
   the limit to 1000. But only 32 show 🙁 Help?
 * [si_feed width=215 link=true tag=9000ifarver limit=1000]
 * [http://vaerk9000.dk/9000ifarver/](http://vaerk9000.dk/9000ifarver/)

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Limit image number’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-instagram_dbdbda.svg)
 * [Simple Instagram](https://wordpress.org/plugins/simple-instagram/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-instagram/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-instagram/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-instagram/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-instagram/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-instagram/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [MarieSvendsen](https://wordpress.org/support/users/mariesvendsen/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/limit-image-number/#post-4509129)
 * Status: resolved