Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Results limit
This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 7 months ago.
- AuthorPosts
- November 5, 2020 at 3:58 pm #30154
hi there
I’ve just started using your plugin so I have no site live just yet but wondered if you could help.I am searching user profiles, and there seems to be a limit on how many users are being displayed in the results.
If I changethe limit, the results increase 3 fold. eg if the limit is 10, then i can iterate (load more) through the results 3 times until i get 30 results. if i increase the limit to 20, i can iterate through results 3 times to then get 60 results.
Am I missing a settin somewhere where I can display ALL my results, and not limit the load more function to 3 times only?
Many thanks
November 5, 2020 at 4:21 pm #30155Hi,
Currently it is programmatically limitet to the 3 folds of the current limit, as you noticed. With the custom post types search this is increased to 10 fold. It is due to performance and a few other reasons.
The only way to increase it currently is by making direct changes to the core plugin code. There is a query argument added that will work in the future releases via a custom code, but not with the current one unfortunately. However I can suggest a modification and a custom code, that will increase this limit (to infinite), patches the current version, and will work in the future one as well:
1. Make sure to have a full site back-up just in case
2. Open up the wp-content/plugins/ajax-search-pro/includes/classes/search/class-asp-search-users.php file on your server
3. Replace it’s contents with this
4. Save the fileNow, a few lines of custom code is also needed. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter( 'asp_query_args', 'asp_change_remaining_limit_mod', 10, 2 ); function asp_change_remaining_limit_mod( $args, $id ) { $args['_remaining_limit_mod'] = 9999999; return $args; }
With these changes, the limit should be lifted. Just make sure to keep the custom code above in your functions.php file, and it will be fine in the upcoming updates as well.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 5, 2020 at 9:46 pm #30157Thanks for getting back to me quickly, however I have tried the code and am now getting the message:
‘The request failed. Please check your connection! Status 500’
November 6, 2020 at 9:28 am #30159I re-tested the code, but it seems to be all right. Can you please add temporary FTP and back-end access? I will try to make the changes directly. Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 10:58 am #30168You cannot access this content.November 6, 2020 at 11:07 am #30169Thank you!
I tried to delete and re-install the plugin to make sure the files are consistent, but it does not let me upload via the plugin manager: https://i.imgur.com/PRZ7Twt.png
Best,
Can you please re-install and activte the plugin? All the settings will remain in tact.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 11:17 am #30171You cannot access this content.November 6, 2020 at 11:22 am #30172Thank you very much. It should be okay now. There was an additional line in the original code that is not yet supported in the current release, it caused the issue. This change will be permanent in the upcoming release, so all you need to keep is the custom code in the theme functions.php file.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 11:28 am #30173You cannot access this content.November 6, 2020 at 11:28 am #30174You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.