Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Display the results information box problem.
This topic contains 6 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 4 months ago.
- AuthorPosts
- November 8, 2021 at 3:00 pm #35462
Even though we enabled “Display the results information box?” option we can’t see result search info on this search. We have experimented with display options but without luck.
Page that contains this search is:
https://strucnaliteratura.rs/pitanja-i-odgovori/We have created simplified version of this page for testing:
https://strucnaliteratura.rs/pitanja-i-odgovori-2/
but does not work on that page too.Documentation does not help with troubleshooting this
Can you check this problem?November 8, 2021 at 3:46 pm #35467Hi,
This feature is available for the live results list when using the plugins results container. Unfortunately the Elementor Results can not be altered to display that at the moment.
Best,
We are working on possible solutions for one of the upcoming releases, it looks like it might be possible, but we may need to consult with Elementor developers for possible integration points.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 8, 2021 at 8:53 pm #35473Thanks for fast response. Hope it will be possible soon.
If possible notify when this feature find way to production version.Best regards,
Danilo CubrovicNovember 9, 2021 at 9:50 am #35474Sure! You should get a notification once a new release is ready, then you can check the changelog for all the new features and fixes.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 11, 2021 at 4:40 pm #35516Hello one more time.
I’m trying to fix this for now buy using shortcode with custom function to show result number.$post_count = $GLOBALS[‘wp_query’]->found_posts;
return “Ukupno rezultata: ” . $post_count;This shows total number of results with empty search but does not reduce that number when searching.
(I have check this function via using time() and it executes ok everytime search executed and refresh data)
So can we use something instead $GLOBALS[‘wp_query’]->found_posts to get valid number of posts when using asp?
If we can get some more information there like search phrase too is even better.November 11, 2021 at 6:07 pm #35517Well I kind of glue this thing but still want to check if I’m missing something. Maybe there is an better solution for this.
I have use asp_results filter to set number of results in global variable so I can use this number for number of results if ajax search is executed.add_shortcode( ‘cekos_elementor_php_output_search_results_info’, ‘get_output_search_results_info’ );
function get_output_search_results_info( $atts) {
global $archive_count_results;
$post_count = $GLOBALS[‘wp_query’]->found_posts;
if ($archive_count_results){
return “Found ” . $archive_count_results.” results from “.$post_count.” posts”;
}else{
return “Found ” . $post_count.” results from “.$post_count.” posts”;
}
}add_filter( ‘asp_results’, ‘asp_custom_link_results’, 10, 1 );
function asp_custom_link_results( $results ) {
global $archive_count_results;
$count_results = count($results);
$archive_count_results = $count_results;
return $results;
}November 12, 2021 at 9:55 am #35522Hi,
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.
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.