[Edited to add: this applies to themes derived from "testing-dev", which have subalbum support]
In the absence of a pukka solution upstream of the page, this will sort subalbums by title. (You can easily work out how to sort by something else). In the file album.php, replace the entire div called "albums" with the following:
Your PHP version may not like the "&" in the "foreach" line, if this is the case, remove the &, it will still work, but will be making copies of the array elements instead of accessing them by reference. Slightly less efficient that's all.
(some long lines will have wrapped and may want repairing when you copy & paste this):
`
<?php function printSortedAlbumThumbImage($alt, $thumb, $class=NULL, $id=NULL) { <br />
echo "
(($class) ? " class="$class"" : "") .
(($id) ? " id="$id"" : "") . " />";
} ?>
<?php while (next_album()):<br />
$title = getAlbumTitle();
$albums[$title]["title"] = $title;
$albums[$title]["url"] = wpGetAlbumLinkURL();
$albums[$title]["desc"] = getAlbumDesc();
$albums[$title]["thumb"] = getAlbumThumb();
endwhile;
if ($albums) {
array_multisort($albums, SORT_ASC);
foreach ($albums as &$album) { ?>
<?php echo $album["desc"]; ?>
<?php } ?>
<?php } ?>
`
Comments
This is a hack though; it'd be better to set the sort_order field in the database once and make the getSubalbums method obey that, which is not difficult. I will have this done in the next release.
I tried to use this code because if for me important to maintain an order in subalbums.
Only worked if I modify
`echo "";} ?>`
with something easier like
`echo "";`
But my question is
How can I sort with some other field else that name?
Someone have some code writen that works?
Thank sin advance.