Forums Forums Search & Filter Pro Displaying & refreshing a “Total Results” value with AJAX search

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #252694

    I am trying to show a dynamic “total” results counter in my sidebar that reflects the total posts returned by each filter. I could really use some guidance on how to do this.

    It’s worth mentioning that I am refreshing the results with AJAX so I can’t have a full page refresh occur.

    Anonymous
    #252695

    I should also mention that I am using Elementor with a custom Archive page. The Post Widget is being used and I am using the Search & Filter Pro Elementor plugin to connect your product to my post feed.

    Trevor
    #252752

    I am not aware of any way to do this where the code that generates the posts content is a coded widget rather than a more traditional PHP template. I am assuming that the Archive Posts widget does not show the total posts count?

    Anonymous
    #252938

    Correct, the archive posts widget does not show the total post count.

    I tried adding some PHP code to the page via a shortcode but it doesn’t refresh when the AJAX call is finished.

    Trevor
    #252944

    You would have to write some Ajax of your own to trigger that, triggered from our sf:ajaxfinish event, like this:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        // call your Ajax script or function here
      });
    }(jQuery));</script>
Viewing 5 posts - 1 through 5 (of 5 total)