Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Ajax Pagination doesn’t work

Viewing 10 posts - 1 through 10 (of 16 total)
  • Erez Cohen
    #236999

    Hi,

    I can’t get the Ajax pagination to work. Every time I click a page link, there is loading animation but the results remain the same.

    I would very much appreciate your help, thank you!

    Erez Cohen
    #237000
    This reply has been marked as private.
    Trevor Moderator
    #237011

    I can see that your are using Elementor Pro, yes?

    The archive posts on the page, are they output using a Posts Archive post module? If they are, we do not (yet) support that module. Instead, you would need to use the Posts module (our plugin will cause it to use the Post Type, Properties, that you want to display).

    It needs to be setup as detailed in this post:

    https://support.searchandfilter.com/forums/topic/how-can-i-search-elemntor-column-while-retaining-the-design-of-that-column/#post-209754

    (Note that the Javascript shown is for the classic layout. If you examine the javascript, you will see where that might need to change, maybe to cards or custom)

    Erez Cohen
    #237043

    Hi Trevor and thank you for your answer.
    Correct, I am using Elementor Pro, however I created a custom widget for the archive (which uses the loop) to display the posts the way I want to, with custom fields, etc.
    If some custom JS is needed to make it work, it’s perfectly fine. Also since it’s a custom widget, I can change it to make it work with the plugin. Just give me some directions 🙂
    Thank you!

    Trevor Moderator
    #237049

    It is a question of how the pagination works. The simplest pagination PHP code is this (based on the WordPress codex):

    <div class="pagination">
      <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
      <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    </div>

    The standard WordPress pagination does not use JavaScript. We use JavaScript, in the case of Ajax refreshing, to instruct the page template to refresh a certain part of the page, but the template would then use PHP to do that.

    Erez Cohen
    #237065

    I’m not sure what you mean – I know how pagination works, it works for me on other pages and it also works with S&F if I turn off Ajax. The problem is, that every time a pagination link is clicked, the same request is sent regardless of the page, so the same posts are displayed.
    Are there any rules for the pagination links to work with S&F? Their href value, or a certain data attribute they should have?

    Trevor Moderator
    #237069

    Looking at the pagination HTML, it is missing the page numbers, which is why it isn’t working. Is this a setting in a module in Elementor that you can change? Elementor usually has three pagination options. I think the Next/Previous one works, but I am unsure about the numbered only and the combination numbers and next/previous. I have a feeling they are done using JavaScript (which we don’t have a workaround for as of yet).

    Erez Cohen
    #237071

    The HTML is generated in a php function that I wrote, I can change it however I want. If you could please show me an example of a link tag that should work, I will change the function accordingly.
    Thanks

    Trevor Moderator
    #237075

    If the function is external to the template, or external to the Ajax Container block of code, that will likely be the issue. Are you able to put the actual code in its place?

    Erez Cohen
    #237083

    I use an Elementor template for the archive page, which contains a custom widget I created. the render function of this widget outputs the posts in the query as well as the pagination in the same container.
    What do you mean by “the actual code”? What code?
    Thank you

Viewing 10 posts - 1 through 10 (of 16 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.