Title: Change Sorting Labels
Last modified: December 19, 2020

---

# Change Sorting Labels

 *  Resolved [johndoe01](https://wordpress.org/support/users/johndoe01/)
 * (@johndoe01)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/change-sorting-labels/)
 * Greetings.
 * I’m a bit lost on a client’s request. My client wants that i should change the
   labels of the sorting options of the category view. I meant as in this image…
   `
   https://i.imgur.com/7pplZR4.png` But for example instead of Newest First change
   the string for Most Recent, Oldest First for Oldest, and so on.
 * Since i have 3 instances based on adverts_list shortcode (To clarify i managed
   to do 2 more clones of the adverts list with some variations on visual layout).
   On those instances I can change the strings of the lines:
 *     ```
       // options: title, post_date, adverts_price
           $sort_options = apply_filters( "adverts_list_sort_options", array(
               "date" => array(
                   "label" => __("Publish Date", "wpadverts"),
                   "items" => array(
                       "date-desc" => __("Newest First", "wpadverts"),
                       "date-asc" => __("Oldest First", "wpadverts")
                   )
               ),
               "price" => array(
                   "label" => __("Price", "wpadverts"),
                   "items" => array(
                       "price-asc" => __("Cheapest First", "wpadverts"),
                       "price-desc" => __("Most Expensive First", "wpadverts")
                   )
               ),
               "title" => array(
                   "label" => __("Title", "wpadverts"),
                   "items" => array(
                       "title-asc" => __("From A to Z", "wpadverts"),
                       "title-desc" => __("From Z to A", "wpadverts")
                   )
               )
           ) );
       ```
   
 * But tried on them and the result appeared without changes. I’m not sure how can
   I change those labels without altering the Core files (which I tried without 
   any obtainable result).
 * I’m not sure if through a mod in the functions can do the job but now i’m lost.
   
   Thanks in advance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchange-sorting-labels%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Greg Winiarski](https://wordpress.org/support/users/gwin/)
 * (@gwin)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/change-sorting-labels/#post-13816047)
 * Hi,
    there are few ways to change the labels, the easiest would be to use a plugin
   like Say What? and customize the “Newest First” phrase.
 * Another option would be to use a adverts_list_sort_options filter to change the
   labels
 *     ```
       add_filter( "adverts_list_sort_options", function( $labels ) {
         $labels["date"]["items"]["date-asc"] = "Most Recent";
         return $labels;
       } );
       ```
   
 * From your question i am not use if you want to make this change on one of the[
   adverts_list] only, if so then inside the code snippet you can add something 
   like
 *     ```
       if( ! is_page( 100 ) ) {
         return;
       }
       ```
   
 * where the 100 is actual ID of the page where the labels should be changed.
 *  Thread Starter [johndoe01](https://wordpress.org/support/users/johndoe01/)
 * (@johndoe01)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/change-sorting-labels/#post-13883146)
 * Thanks for reply.
 * Tried with Say What? and i had no results. Used the code and does as I need, 
   even on the variations pages.

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

The topic ‘Change Sorting Labels’ is closed to new replies.

 * ![](https://ps.w.org/wpadverts/assets/icon-256x256.png?rev=2423472)
 * [WPAdverts - Classifieds Plugin](https://wordpress.org/plugins/wpadverts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpadverts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpadverts/)
 * [Active Topics](https://wordpress.org/support/plugin/wpadverts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpadverts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpadverts/reviews/)

## Tags

 * [change labels](https://wordpress.org/support/topic-tag/change-labels/)

 * 2 replies
 * 2 participants
 * Last reply from: [johndoe01](https://wordpress.org/support/users/johndoe01/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/change-sorting-labels/#post-13883146)
 * Status: resolved