Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Display the results information box problem. › Reply To: Display the results information box problem.
November 12, 2021 at 9:55 am
#35522
Keymaster
Hi,
Okay, so this might not be as simple. The $wp_query->found_posts will have the correct number of results – but the $wp_query object may not be the global variable. When the page is rendered, there are many queries executed, and there is almost no way to tell which one is for the elementor query – and that may not even be set to the $wp_query global.
The code you have there is a very clever solution, and if it works, I would recommend sticking to that. I don’t think there is a better way for it at the moment.