Title: Sorting Issue
Last modified: August 30, 2016

---

# Sorting Issue

 *  [ridgetek](https://wordpress.org/support/users/ridgetek/)
 * (@ridgetek)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sorting-issue-6/)
 * Hi,
    When I have multiple pages of property data and use the sortby function 
   the sorting works fine.
 * However, if I happen to be on page 3 of the listings when I select the sort options
   it remains on page 3 after sorting instead of returning back to the start of 
   the listings.
 * Is there a way I can force it back to page 1 when I choose a sort option ?
 * Thanks,
 * Pete
 * [https://wordpress.org/plugins/easy-property-listings/](https://wordpress.org/plugins/easy-property-listings/)

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

 *  [Marco Andrei Kichalowsky](https://wordpress.org/support/users/marcoandrei/)
 * (@marcoandrei)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/sorting-issue-6/#post-6531150)
 * Dear ridgetek,
 * No. This is the behaviour by default in version 3.0.4 (the current version at
   time I write this). I had the same problem.
 * I resolved my problem modifing the way the URL is recalled in EPL/lib/assets/
   js/jquery-front-scripts.js file.
 * 1. Search for the comment “/* Sort properties by price */” in this file. This
   is the function to recreate the URL to be called after the search.
 * 2. After variables declaration, insert this code:
 *     ```
       var where = url.search('page');
   
       if (where > -1) {
       	var url = url.substring(0,where);
       }
       ```
   
 * `url` is the variable that contains the current URL. The code above locates the
   word “page” and passes to the `url` variable only the part before the word, forcing
   the site to return to the first page.
 * Saúde!
    Marco Andrei
 *  Thread Starter [ridgetek](https://wordpress.org/support/users/ridgetek/)
 * (@ridgetek)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/sorting-issue-6/#post-6531151)
 * Thank you for the response – appreciated.
 *  Plugin Author [Merv Barrett](https://wordpress.org/support/users/mervb1/)
 * (@mervb1)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/sorting-issue-6/#post-6531152)
 * Marking this as an Issue in GitHub for a fix for 3.1 Thanks for letting us know
   Pete and Marco
 *  [Marco Andrei Kichalowsky](https://wordpress.org/support/users/marcoandrei/)
 * (@marcoandrei)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/sorting-issue-6/#post-6531153)
 * Merv,
 * Tudo bem?
 * IMHO, I think it would be nice to have the option to choose what behavior the
   user wants to have.
 * Saúde!
    Marco

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

The topic ‘Sorting Issue’ is closed to new replies.

 * ![](https://ps.w.org/easy-property-listings/assets/icon-256x256.png?rev=984159)
 * [Easy Property Listings](https://wordpress.org/plugins/easy-property-listings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-property-listings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-property-listings/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-property-listings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-property-listings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-property-listings/reviews/)

## Tags

 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [sortby](https://wordpress.org/support/topic-tag/sortby/)

 * 4 replies
 * 3 participants
 * Last reply from: [Marco Andrei Kichalowsky](https://wordpress.org/support/users/marcoandrei/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/sorting-issue-6/#post-6531153)
 * Status: not resolved