Forums Forums Search & Filter Pro Issue with getting previous posts

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

    Hello,

    I am having some trouble setting up the pagination on my results page.
    For some reason “previous_posts_link” is not outputting an “a href”, any solutions to this?
    I got the pagination code out of the plugin template folder.

    Ajax Pagination Setup in filter:
    Pagination type: Normal
    Pagination selector: .pagination a

    URL where problem is situated:
    https://cordacampus.dev.expliciet.be/corda-companies/

    Code used for pagination:
    https://pastebin.com/UjgU3X5D

    Ross Moderator
    #245145

    Hi Thomas

    It looks like you are uinsg display method = shortcode?

    That uses a $query for the results – otherwise known as a “custom query”.

    The function previous_posts_link and next_posts_link apparently support custom queries if you add max_num_pages as the second parameter (I didn’t test this):

    https://stackoverflow.com/a/15567906

    Alternatively, you can use the code provided in the results.php template file in our plugin:
    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    Thanks

    Anonymous
    #245464

    Hello Ross,

    I have converted my code to a custom WP Query.
    Code now: https://pastebin.com/gLrvSCHS

    Previously I used the code provided in the results.php, but that did not work either…

    Anonymous
    #245493

    I need a fix on this asap.
    Project needs to go live on monday.

    Ross Moderator
    #245685

    Hi Thomas

    I’m not sure why that wouldn’t work – if you use display method “shortcode” and then use our template “results.php” you will see it working?

    Do you have a link I could look at?

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)