Title: Thumbnail Order
Last modified: August 20, 2016

---

# Thumbnail Order

 *  [Banners](https://wordpress.org/support/users/banners/)
 * (@banners)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/)
 * Currently, by default, YASG doesn’t reflect changes in the order of the thumbnails
   in the gallery ie. the order shown by the “[gallery ids=1,2,3]” shortcode.
 * Is there a way to get the order of the thumnbails generated by YASG to match 
   the order in the shortcode?
 * [http://wordpress.org/extend/plugins/yet-another-simple-gallery/](http://wordpress.org/extend/plugins/yet-another-simple-gallery/)

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

 *  [John Huebner](https://wordpress.org/support/users/hube2/)
 * (@hube2)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571741)
 * See my corrective action for the problem I was having here: [http://wordpress.org/support/topic/adding-photos-not-in-gallery](http://wordpress.org/support/topic/adding-photos-not-in-gallery)
 * To make the order be as they are supposed to be, change the code in the second
   part to this
 *     ```
       if ($post__in != '') {
       		$args['order_by'] = $post__in;
           $args['post__in'] = explode(',', $post__in);
         }
       ```
   
 * This corrected the situation for me.
 * Of course, changing the coding will mean you can’t update this plugin without
   redoing any changes. Like I said in the other thread, hopefully if this plugin
   is every updated it will include these changes/fixes.
 *  Thread Starter [Banners](https://wordpress.org/support/users/banners/)
 * (@banners)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571768)
 * Thank you very much for your input.
 * I have made the two additions to “yasg.php” as you have suggested, but nothing
   has changed. I have tried commenting-out the ‘orderby’ and ‘order’ values in 
   the $args array section, and changing ‘order_by’ to ‘orderby’ to see if that 
   would help – but still the order of the thumbnails on the site doesn’t change
   to reflect the order shown in the gallery.
 * Where do you think I may be going wrong?
 * Thanks again.
 *  [John Huebner](https://wordpress.org/support/users/hube2/)
 * (@hube2)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571784)
 * Sorry, there is a typo in the code above. try this:
 *     ```
       if ($post__in != '') {
       		$args['orderby'] = $post__in;
           $args['post__in'] = explode(',', $post__in);
         }
       ```
   
 * “order_by” should be “orderby”
 *  Thread Starter [Banners](https://wordpress.org/support/users/banners/)
 * (@banners)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571792)
 * Still no joy here I’m afraid.
 * The first iteration of the code removes the Featured Image, but using the code
   above, I still can’t get the order of the thumbnails to change. Is there anything
   you think I may be doing wrong?
 * Thank you.
 *  [John Huebner](https://wordpress.org/support/users/hube2/)
 * (@hube2)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571794)
 * Sorry, sometimes I’m just guessing 🙂 What I did was I looked into the function
   in the core that show the gallery.
 * I just looked again and I may coppied what they were doing wrong. It seemed to
   work for me, but maybe the images in the galleries my client has are in the same
   order by a coincidence.
 * Anyway, try changing the cold above to $args[‘orderby’] = ‘post__in’;
 *     ```
       if ($post__in != '') {
           $args['orderby'] = 'post__in';
           $args['post__in'] = explode(',', $post__in);
         }
       ```
   
 *  Thread Starter [Banners](https://wordpress.org/support/users/banners/)
 * (@banners)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571850)
 * Wow – that seems to be working great now. Thanks so much!
 *  [John Huebner](https://wordpress.org/support/users/hube2/)
 * (@hube2)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571867)
 * Glad I could help. I like the way this plugin works because it allows editors
   to use built in WP features rather than needing to use short tags or some other
   more obtuse way to create a Gallery. Hopefully it has not been abandoned.

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

The topic ‘Thumbnail Order’ is closed to new replies.

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

 * 7 replies
 * 2 participants
 * Last reply from: [John Huebner](https://wordpress.org/support/users/hube2/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-order/#post-3571867)
 * Status: not resolved