Support » Plugin: Yet Another Simple Gallery » Thumbnail Order

Viewing 7 replies - 1 through 7 (of 7 total)
  • See my corrective action for the problem I was having here: 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

    (@banners)

    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.

    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

    (@banners)

    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.

    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

    (@banners)

    Wow – that seems to be working great now. Thanks so much!

    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.