Need help? Check out our Support site, then


Sort gallery by ID?

  1. i wonder if there is a gallery code for sorting the image by id?

    the problem is that when i upload a file "name01, name02, name03" the name03 will come first and name 02 second and name01 will be in the end of the post, i want it to be like: name01, name02, name03.

    i am using this gallery shortcut: [gallery columns="1" size="medium"]

  2. There is an orderby option that you can use.

    http://codex.wordpress.org/Using_the_gallery_shortcode

    It's much easier to simply click on the Add an Image button and then change to the Gallery tab, where you can drag and drop the images to whatever order you want them to appear in the gallery.

  3. Hi! i know that i can drag and drop the images but its a pain when you have 40+ pics on at post, its takes just to much time to drag and drop images by id :)

    about the shortcut, i did a take a look at the gallery shortcut page but didnt understand what to write in the shortcut code :/ what should i write in this shortcut to have the images sorted by name? [gallery columns="1" size="medium"]

  4. Put orderby="ID ASC" between the brackets.

    It appears that file name is ID, so if you want your photos in a different order, you'll have to do it manually anyway.

  5. Try this:
    gallery columns="1" size="medium" sortby="ID DESC"]

  6. Let me clarify that ID one step further.

    ID is the name of the file when you upload it; not the title or caption you may give it after uploading.

  7. hmmm i tried both [gallery columns="1" size="medium" sortby="ID DESC"] and

    [gallery columns="1" size="medium" orderby="ID ASC"]

    but non of those shortcuts codes seems to work :/ the name1 pic is still at the end of the post while name45 pic is on top :(

    any other codes that i can try?

  8. Then orderby="ID DESC" should do it.

  9. panaghiotisadam
    Member

    If not, how about orderby="post_name ASC" ?

  10. dammit, both

    [gallery columns="1" size="medium" orderby="ID DESC"]

    and

    [gallery columns="1" size="medium" orderby="post_name ASC"]

    didnt work. its still the same as before :/

  11. phattrance, are you talking about a blog you have here on wordpress.COM? I know that you were on COM at one point (and remember your question to me about the social bookmarking tool I'm using), but it looks like the current blog is a self-hosted WordPress install.

  12. i just moved to a .org blog but since the gallery shortcut is the same i asked here (cause the help here is WAAAAY better than the .org forum)

    anyway, i have tried different shortcuts and EVEN did the sorting by "order" box @ add media and it still did put the name5 pc on top and the name1 pic were at the end of the post..

    i found a way to make it alright but its stupid that i need to do it this way :) i just renamed the name05 pic to name01 and the image uploader will upload it backwards, lol

  13. The only trouble with asking here is that in general the software you are using is different than WordPress.COM users use, so your results may be different. Just sayin'...

  14. Same need and same problem than you Phattrance, see my post http://en.forums.wordpress.com/topic/problem-with-gallery-ordering-orderby-desc-or-asc?replies=2#post-238708

    Hope the WP team will be able to fix it

Topic Closed

This topic has been closed to new replies.

About this Topic