WordPress.org

Forums

Pretty file list
[resolved] Sorting File List (5 posts)

  1. Frederik
    Member
    Posted 2 years ago #

    Hey,

    I have to say that is a great plugin (very simple and to the point). I really appreciate this plugin for its ease of use and great looks.

    I still was wondering if there is an option to have the files sorted (for example alphabetically or a custom order). I tried setting the order in the media gallery library, but this doesn't work. Also checked out the code, but I'm not really good at php ;-)

    Is there a way to make the file list sorted alphabetically.

    Either way, big two thubms up for this super plugin, love it :-)

    Best Regards,
    Frederik

    http://wordpress.org/extend/plugins/pretty-file-lister/

  2. smartredfox
    Member
    Plugin Author

    Posted 2 years ago #

    Hello Frederik,

    Thanks for using the plugin, and I'm glad you like it.

    Currently there is no sorting option in the free version of the plugin (I'm working on a more fully featured pro version), but I will try to filter this down into the free version as soon as the Pro version is complete.

    Thanks again,
    James

  3. Ruud Evers
    Member
    Posted 2 years ago #

    You can do this by editing the PrettyFileList.php file in the plugin directory. However, note that these changes will be overwritten by a plugin update. (But since the author gives the sign he is going to include this option, that might not be a problem.)

    Open the PrettyFileList.php file and go to line 80. There you will find the following code:
    $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => get_the_id(), 'post_mime_type' => $mimeTypesToGet);

    Just add the following into the array:
    'order'=> 'ASC', 'orderby' => 'title'

    so it will look like this:
    $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => get_the_id(), 'order'=> 'ASC', 'orderby' => 'title', 'post_mime_type' => $mimeTypesToGet);

    No the list will be sorted alphabetically.

  4. smithgt
    Member
    Posted 2 years ago #

    What about making this list sort in Reverse?

    Is that possible too?

    thanks

  5. Ruud Evers
    Member
    Posted 2 years ago #

    Yes, just change
    'order'=> 'ASC', 'orderby' => 'title'
    into
    'order'=> 'DESC', 'orderby' => 'title'

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pretty file list
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic