Pagination Not Working

  • NTINC
    Participant
    # 1 year, 10 months ago

    We are using pro version, we noticed that pagination starts at 0, when you click page 2 it loads page 1 which is duplicate of initial results set. So in pagination page 1 and 2 are duplicates. Any ideas?

    wpsolr
    Keymaster
    # 1 year, 10 months ago

    Can you check your debug.log, and js console errors?

    NTINC
    Participant
    # 1 year, 10 months ago

    Yes, checked the debug log and js console no errors that would relate to this. There is js error that deals with select2 which is used on a filter.

    wpsolr
    Keymaster
    # 1 year, 10 months ago

    Did you customize WPSOLR’s code?

    NTINC
    Participant
    # 1 year, 10 months ago

    No we are using out of the box template.

    wpsolr
    Keymaster
    # 1 year, 10 months ago

    With your theme’s search template, or the WPSOLR’s Ajax search template?

    webmasterbslnl
    Participant
    # 1 year, 9 months ago

    I noticed the same problem using WPSOLR’s Ajax search template. Pagination button ‘1’ links to &page=0. PM me if you need a demo.

    wpsolr
    Keymaster
    # 1 year, 9 months ago

    This pagination problem will be fixed with the next release.
    Here is a workaround in the meantime:
    – Edit file /wp-content/plugins/wpsolr-pro/wpsolr-templates/twig/search/pagination.twig
    – On line 17, replace id="{{ page }}" with id="{{ page+1 }}"

    wpsolr
    Keymaster
    duck
    Participant
    # 1 month, 1 week ago

    Pagination is currently showing the next page highlighted in the pagination instead of the current page. When on page 1 it highlights and turns the text red for page 2. Page 2 shows 3 in red and so on. I tried changing the twig template and either introduced a negative number or a 0 but the identification was still never on the correct page.

    Also, the page does not go back to the top of the page when switching to the next pagination page. Is this normal behavior or is it supposed to go back to the top of the page?

    duck
    Participant
    # 1 month, 1 week ago

    I was able to fix the incorrect pagination identifier by changing this line:
    <a class=”paginate {{ (page == pages.current_page) ? ‘active’ : ” }}”
    to:
    <a class=”paginate {{ (page == pages.current_page -1) ? ‘active’ : ” }}”

    Is there a way to turn off ajax pagination so that the page will reload at the top on the next page? So that the user does not need to scroll back up each time.

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    Ajax pagination is triggered on css selector ‘a.page-numbers,a.paginate’.
    You can set it up differently on the “Theme” add-on, with a non-existing selector for instance. Or change the twig template’s <a class="paginate" ... > to something else.

    • This reply was modified 1 month, 1 week ago by wpsolr.
Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.