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
- The topic ‘Ordering items’ is closed to new replies.