Change private files attachment order
To sort files by alphabetical order instead of chronological order, you can use this snippet in your theme’s functions.php file. function cuar_change_file_order_on_display($files, $post_id) { uasort($files, function($f1, $f2) { return strcasecmp($f1[‘caption’], $f2[‘caption’]); }); return $files; } add_filter(‘cuar/private-content/files/the-files’, ‘cuar_change_file_order_on_display’, 10, 2);
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed