I found the solution for this:
Add a Shortcode for the Search Count:
- Go to Appearance > Theme Editor (or use a custom plugin or code snippet plugin like “Code Snippets” to add custom code).
- Add the following code to your theme’s
functions.php
file or the custom code area in your plugin:
function display_search_count() { global $wp_query; $total_results = $wp_query->found_posts; return $total_results . ' results found'; }
add_shortcode('search_count', 'display_search_count');
Add the Shortcode in Elementor:
- Edit your Search Results template in Elementor.
- Add a Text widget where you want to display the search result count.
- Use the shortcode
[search_count]
inside the Text widget.