Title: Reverse Sort from File System
Last modified: August 30, 2016

---

# Reverse Sort from File System

 *  [e dev](https://wordpress.org/support/users/efishinsea/)
 * (@efishinsea)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort-from-file-system/)
 * Opening caveat – I never recommend editing plugins directly, but when you have
   no other choice, that is what needs to be done.
 * When using this plugin and pulling files directly from the file system, there
   seems to be no way to reverse sort the list (Z – A)… which I am using to show
   the newest files (by date) in a playlist.
 * To overcome this limitation, you can edit the main.php file around line 952 to
   add this:
 *     ```
       }
       	//add this to reverse sort
       	$TRACKS = array_reverse($TRACKS);
   
       return $TRACKS;
       }
       ```
   
 * just before the return. This will return your playlist from your file system 
   in reverse order.
 * Also, in our case, the plugin uses a different version of jQuery than our theme,
   which causes conflicts and breaks the player completely. Either the theme or 
   the plugin is not using jQuery.noConflict() so they do bump heads.
 * My fix for this (since I can’t alter this particular theme) is to again edit 
   the plugin file /js/mp3-player-{your version}.js in 2 places:
 * once around line 574 :
 *     ```
       //replace this
       //jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp );
   
       //with this
       jQuery(this.eID.pos + j).live( 'click', MP3_JPLAYER.stopProp );
       ```
   
 * and again around line 828:
 *     ```
       //replace this
       //jQuery(this.eID.pos + j).on( 'click', MP3_JPLAYER.stopProp );
   
       //with this
       jQuery(this.eID.pos + j).live( 'click', MP3_JPLAYER.stopProp );
       ```
   
 * this will fix the error and allow the player to work.
 * I think both of these issues could be fixed with the plugin by allowing the shortcode
   to allow sorting when using the file system, and also editing the JS to be more
   jQuery version agnostic.
 * Thanks!
 * [https://wordpress.org/plugins/mp3-jplayer/](https://wordpress.org/plugins/mp3-jplayer/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [simon.ward](https://wordpress.org/support/users/simonward-1/)
 * (@simonward-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort-from-file-system/#post-6554185)
 * Hello,
 * you can reverse the order directly from the settings page, there should be no
   need to modify code. There are ASC / DESC settings for both library files and
   folder files there. They’re on the first tab under ‘Bulk play’.
 * The jQuery ‘live’ function has been deprecated since jQuery 1.7. I really don’t
   recommend doing this.
 * It would be much better to fix the theme’s problems rather than trying to run
   outdated libraries in your pages. This will likely cause all sorts of problems
   for you now and in the future, and it’s not maintainable.
 * Simon
 *  Thread Starter [e dev](https://wordpress.org/support/users/efishinsea/)
 * (@efishinsea)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort-from-file-system/#post-6554191)
 * You’re right Simon, and as mentioned, changing the plugin is the worst of all
   solutions and I don’t recommend it.
 * In this case, the theme *is* at fault and not the plugin, but if the theme can’t
   be edited for whatever reason (I can’t change this one), then replacing ” .on
   and .off ” with “.live” as described does remedy this issue and allow the plugin
   to work.
 * The sorting does work, but I was confused. “Order Folders By” controls the *file
   list* generated by the FEED and was not set appropriately. I only had “Order 
   Library By” set to DESC, which did nothing. Thanks for setting me straight.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Reverse Sort from File System’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mp3-jplayer_c3a59d.svg)
 * [MP3-jPlayer](https://wordpress.org/plugins/mp3-jplayer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mp3-jplayer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mp3-jplayer/)
 * [Active Topics](https://wordpress.org/support/plugin/mp3-jplayer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mp3-jplayer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mp3-jplayer/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [e dev](https://wordpress.org/support/users/efishinsea/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/reverse-sort-from-file-system/#post-6554191)
 * Status: not resolved