Help: Increasing amount of Search Results Returned


I’m having trouble finding a solution to display more than 50 search results on my search results template page. I have already set the amount to display within WP backend (Settings>reading), and in the theme (DiviThemeOptions>"Number of Posts displayed on Search pages). I have tried with 500, 666, 999, 1200, no matter what I do I cannot seem to get more than 50 results to appear on the results page. I believe that the search is finding well over 50 results, however 50 seems to be the cutoff on the results page.

In the URL of the search results I see: “et_pb_searchform_submit=et_search_proccess&et_pb_include_posts=yes&et_pb_include_pages=yes” after the search term. So I assume that the search is generating multiple pages of results (include_pages_yes) and the links to the subsequent pages are either being hidden, or not called. In the page template there is an if statement to check for wp_pagenavi, and then execute it if it’s there, but it does not appear to be executing.

Can anyone lend me a hand with either getting more than 50 results to display or getting the “next page” links to appear/work?

You can view a development example here: Here.

Scrolling to the bottom and searching a term like “sea” or “fish” will bring you to a results page. This site is running on a child theme of uptodate Divi, and using Ajax Search Pro (I have been using the same desired amount of search results returned within this plugin as well). I can also provide my search page template code if requested.

By the way…I am using css to hide the footer and a hook to display my own footer in it’s place but I didn’t think that the “wp_pagenavi” would be located in the footer, as it sits above it in the code.

Many thanks for any ideas or help with this, I’ve been on google and stackexchange for almost 3 days looking for solutions but have had no luck.

i would try to track down the code that is capable of the search function, starting with any function that is used within the template to generate search results.

Thanks for the response chorn! hmmmm I’m not sure I fully understand you. The search results page itself doesn’t perform the search, it’s just where the results are displayed. I do see the loop that displays the search results however it seems to be more of the standard wp/divi index page to display post content. Is this where you mean? I use Ajax Search Pro to do the search so the code that’s doing the searching is in those plugin files.

There are no references to “paged”, “pages” or “posts_per_page” that I can find. The only thing that appears that it could be of use is the wp_pagenavi() which is checked for in an “if” statement near the bottom of the code outside of the main loop. I can post or send if that would be of help…

I’ve done some testing with var_dump() on the search results page and it appears that my settings in the theme/backend to return 500 results/posts per page ARE in fact being set on that page.

var_dump($posts_per_page) is showing 500
var_dump($paged), is showing 1 (I am assuming this is 1 for true, meaning “paged” is on?)

Any ideas as to why those settings are apparently being ignored?

If your initial question/problem is that changes you made to the ‘results limit’ weren’t taking effect, it is probably because ajax is being used and until you reloaded the page, the previous setting was still being used. Your page is currently showing x00 results. I suspect there is also some maximum result value, but afaik, it’s not the WP Settings>reading value.

If your current question/problem is that you are not getting pagination links or a ‘more results’ link, it is because of the layout you are using (vertical) and that infinite scroll is on. To get the actual 1,2,… pagination links, you must use the isotopic layout. To get a ‘more results’ link with the vertical layout, you must turn off the infinite scroll and if grouping is on, you must turn it off too.

Hey PhDr,
Thank you for the response and thoughts/troubleshooting, it is very much appreciated.
Indeed you are correct in both senses here, haha, and in fact I discovered that before I saw your post unfortunately.

I was actually looking for a solution to see all the results, no matter if that meant getting pagination to work or if I could get them all on one page (ideal).

I was getting into the whole pagination thing a bit yesterday but after some troubleshooting with the theme developers I was passed off to deal with ASP, as we determined that the problem was related to the plugin. I then spent some time searching old ASP tickets and sure enough I found a settings page to set “Limits”!! Yes indeed there was a hard limit set, that was not on a related page with “Search Results” and similar settings pages! I changed the limit and am having no issues displaying upwards of 600 results, so the problem is solved…drrrr feel like a bit of a jerk, but it’s not my first rodeo and I know it happens. Sorry for troubling everyone here and on slack but I appreciate the responses, help and suggestions and I have learned a bit as well…
Thanks and Peace~

Sponsor our Newsletter | Privacy Policy | Terms of Service