how to order documents by name instead of date

Viewing 8 posts - 1 through 8 (of 8 total)
#126490

Fabien Galiana
Participant

Hello
all documents are shown / ordered by date. latest added first. but how can we order them by name instead, beginning by numbers and A ?
thx !

#126630

Nayeem Riddhi
Moderator

Hi,

Which shortcode you are using? generally, you can use order_by="title" for ordering them by name. please check

Thanks.

#127567

Fabien Galiana
Participant

there is no shortcode, the documents lists are direct links from categories assigned as menu items.

#127595

Nayeem Riddhi
Moderator

Can you provide the page link for the clarification?

Thanks.

#127598

Fabien Galiana
Participant
This reply has been marked as private.
#127607

Nayeem Riddhi
Moderator

Hello,

Please, give your temporary wp-admin login details in a private reply for the adjustments.

Thanks.

#127613

Fabien Galiana
Participant
This reply has been marked as private.
#128088

Nayeem Riddhi
Moderator

Hi,

Thanks for your having patience, I have just adjusted sorting using the below code putting in your theme functions.php

add_action( 'pre_get_posts', 'wpdm_sort_staff_cat' );
function wpdm_sort_staff_cat( $query ) {
        if ( $query->is_tax() || $query->is_post_type_archive('wpdmpro') ) {
            $query->set('orderby', 'title');  
            $query->set('order', 'desc'); 
               
    }
}

Thanks.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘how to order documents by name instead of date’ is closed to new replies.