A quick fix some people might be interested in is how to sort the files listed on the theme editor page alphabetically. Some themes can have a large number of files and the default WordPress coding puts the list in no particular coding, making it difficult to track down a particular page. The addition of 2 lines of code can order the list to make it easier to work with.
- Save a copy of wp-admin/theme-editor.php to your local computer
- Backup the original version
- Open the local copy with a plain text editor (notepad works nicely)
- Around line 35 there should be a statement identical to:
$allowed_files = array_merge($themes[$theme][‘Stylesheet Files’], $themes[$theme][‘Template Files’]); - After this insert the following two lines directly after:
natcasesort($allowed_files);
$allowed_files = array_values($allowed_files); - Save your copy and upload it back to the server
- Presto, list of files is now in alphabetical order
This will order by filename, but some files might display aliases like “Stylesheet” instead of styles.css, but it will still sort using styles.css, just be aware of that.