• Resolved Ayoub Assaidi

    (@joepifydotnl)


    how to Display amount in search result page elementor in customized page ?

    like this “results found: 10 posts” , i tried so many things nothing works, I would you will help me guys with this

Viewing 1 replies (of 1 total)
  • Thread Starter Ayoub Assaidi

    (@joepifydotnl)

    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.
Viewing 1 replies (of 1 total)
  • The topic ‘Display amount in search result page elementor’ is closed to new replies.