Gallery Image Ordering
The order of images in a gallery is determined by the alphabetical sorting of your filenames. Understanding this helps you control how your images appear to visitors.
How File Naming Affects Order
Without Padding Zeros (Problematic)
When filenames lack padding zeros, the sorting order can appear confusing:
1.jpg
10.jpg
100.jpg
101.jpg
...
11.jpg
110.jpg
111.jpg
```
### With Padding Zeros (Recommended)
Adding padding zeros creates the logical order you expect:
```
001.jpg
002.jpg
...
010.jpg
011.jpg
...
100.jpg
101.jpg
Best Practice for File Naming
Use consistent padding zeros in your filenames to ensure images appear in the correct sequence. For example:
- Use
001.jpg, 002.jpg, 003.jpginstead of1.jpg, 2.jpg, 3.jpg - For larger collections, use
0001.jpg, 0002.jpgformat
Batch Renaming Tools
If you need to rename multiple files at once, search for "batch rename" or "rename files" tools online. These utilities make it easy to add padding zeros to existing filename sequences.
Proper file naming from the start saves time and ensures your galleries display exactly as intended.
