WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A client of mine wishes to not have to sort images uploaded into a post gallery, but instead rely on its filename for sorting (e.g. "01_sample.jpg", "02_sample.jpg"). This would save a lot of time for the client, and I'm wondering if this is possible to achieve using WP 3.5+ and the recent changes to Add Media?

share|improve this question
up vote 1 down vote accepted

When you or the client add the gallery shortcode, you can add an "orderyby" option to specify the order of the images. Per the Codex page on the gallery shortcode:

[gallery ids="729,732,731,720" orderby="title"]

... will do what you're wanting.

share|improve this answer
Thanks! My client will be happy to hear this :) – Staffan Estberg Feb 21 '13 at 10:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.