Title: Ordering items
Last modified: August 22, 2016

---

# Ordering items

 *  Resolved [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/ordering-items/)
 * Hi,
 * I have been trying to order files under the my files section.
 * After some research I found this on your website:
 * ‘ function cuar_custom_sorting_order( $args ) {
    $new_args = $args;
 *  // The next line says that the sort order will be by the date of the last modification
   //
   You could also sort by any field of the WordPress post table, like ‘title’ $new_args[‘
   orderby’] = ‘modified’;
 *  // This line says that we want to sort by descending order (opposite of ‘ASC’)
   
   $new_args[‘order’] = ‘DESC’;
 *  return $new_args;
    }
 * // You can change the page slug to another one, for instance ‘customer-pages’
   or ‘customer-conversations’
    $page_slug = ‘customer-files’;
 * // Uncomment the add_filter line you need, depending on where you want to change
   the sorting order
 * // 1. Change the order on the “My files” page (for any display mode)
    // add_filter(‘
   cuar/core/page/query-args?slug=’ . $page_slug, ‘cuar_custom_sorting_order’ );
 * // 2. Change the order on the “My files” page (not when we are showing date archives
   or category archives)
    // add_filter( ‘cuar/core/page/query-args?slug=’ . $page_slug.‘&
   display-mode=default’, ‘cuar_custom_sorting_order’ );
 * // 3. Change the order on the “My files” page (when showing date archives)
    //
   add_filter( ‘cuar/core/page/query-args?slug=’ . $page_slug . ‘&display-mode=date_archive’,‘
   cuar_custom_sorting_order’ );
 * // 4. Change the order on the “My files” page (when showing category archives)
   //
   add_filter( ‘cuar/core/page/query-args?slug=’ . $page_slug . ‘&display-mode=category_archive’,‘
   cuar_custom_sorting_order’ );
 * // 5. Change the order on the “Dashboard” page
    // add_filter( ‘cuar/core/dashboard/
   block-query-args?slug=’ . $page_slug, ‘cuar_custom_sorting_order’ ); ‘
 * However after implementing this I cant see any difference, I am trying to order
   all files uploaded into the customer area so that the top one is the latest published
   file.
 * Have I missed something??
 * Thanks,
 * Sam
 * [https://wordpress.org/plugins/customer-area/](https://wordpress.org/plugins/customer-area/)

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

 *  Plugin Contributor [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * (@vprat)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/ordering-items/#post-5470827)
 * You need to uncomment the add_filter lines
 *  Thread Starter [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/ordering-items/#post-5470869)
 * Hi,
 * I tried to remove the commenting however this does not appear to have worked.
   Have I missed something?
 * function cuar_custom_sorting_order( $args ) {
    $new_args = $args;
 *  // The next line says that the sort order will be by the date of the last modification
   //
   You could also sort by any field of the WordPress post table, like ‘title’ $new_args[‘
   orderby’] = ‘modified’;
 *  // This line says that we want to sort by descending order (opposite of ‘ASC’)
   
   $new_args[‘order’] = ‘DESC’;
 *  return $new_args;
    }
 * // You can change the page slug to another one, for instance ‘customer-pages’
   or ‘customer-conversations’
    $page_slug = ‘customer-files’;
 * // Uncomment the add_filter line you need, depending on where you want to change
   the sorting order
 * //1. Change the order on the “My files” page (for any display mode)
    add_filter(‘
   cuar/core/page/query-args?slug=’ . $page_slug, ‘cuar_custom_sorting_order’ );
 * // 2. Change the order on the “My files” page (not when we are showing date archives
   or category archives)
    add_filter( ‘cuar/core/page/query-args?slug=’ . $page_slug.‘&
   display-mode=default’, ‘cuar_custom_sorting_order’ );
 * // 3. Change the order on the “My files” page (when showing date archives)
    add_filter(‘
   cuar/core/page/query-args?slug=’ . $page_slug . ‘&display-mode=date_archive’,‘
   cuar_custom_sorting_order’ );
 * // 4. Change the order on the “My files” page (when showing category archives)
   
   add_filter( ‘cuar/core/page/query-args?slug=’ . $page_slug . ‘&display-mode=category_archive’,‘
   cuar_custom_sorting_order’ );
 * // 5. Change the order on the “Dashboard” page
    add_filter( ‘cuar/core/dashboard/
   block-query-args?slug=’ . $page_slug, ‘cuar_custom_sorting_order’ );
 * Thanks,
 * Sam
 *  Plugin Contributor [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * (@vprat)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/ordering-items/#post-5470872)
 * You surely have missed something but I can’t spot it.
 *  [echappee06](https://wordpress.org/support/users/echappee06/)
 * (@echappee06)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/ordering-items/#post-5470885)
 * Hi,
 * I had the same issue.
    You need to replace the line “$page_slug = ‘customer-files’;”
   with “$page_slug = ‘customer-private-files’;”.
 *  Thread Starter [marshallsam](https://wordpress.org/support/users/marshallsam/)
 * (@marshallsam)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/ordering-items/#post-5470886)
 * Hi,
 * I will give that a go and let you know the outcome.
 * Thanks for sharing your fix.
 * Thanks,
 * Sam
 *  Plugin Contributor [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * (@vprat)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/ordering-items/#post-5470887)
 * You can have a look at the “Customer Area > Status > Pages” screen. You have 
   all the page slugs there.

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

The topic ‘Ordering items’ is closed to new replies.

 * ![](https://ps.w.org/customer-area/assets/icon-256x256.png?rev=1288039)
 * [WP Customer Area](https://wordpress.org/plugins/customer-area/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/customer-area/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/customer-area/)
 * [Active Topics](https://wordpress.org/support/plugin/customer-area/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/customer-area/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/customer-area/reviews/)

## Tags

 * [published](https://wordpress.org/support/topic-tag/published/)
 * [sorting](https://wordpress.org/support/topic-tag/sorting/)

 * 6 replies
 * 3 participants
 * Last reply from: [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/ordering-items/#post-5470887)
 * Status: resolved