Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    Hi there, are you sure you have more than 12 matching results for a particular search? I can see a point about search redirecting a user back to the 1st page, just not sure how to go about that.

    What about changing this line:
    $page = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;

    in simple-user-listing.php to this:
    $page = ( get_query_var( 'paged' ) && ! isset( $_POST['as'] ) ) ? get_query_var( 'paged' ) : 1;

    Though I don’t think that will cause a redirect.

    Thread Starter SpeedOfLike

    (@speedoflike)

    Hi. Thanks for the quick response.

    We don’t have 12 results for most queries. The issue is that on that page (https://jgirlsmagazine.org/contributors/), we list ALL USERS of a specific role, of which we have over 100. Now, when someone goes to page 2 by hitting the “next” link at the bottom, it goes to https://jgirlsmagazine.org/contributors/page/2/, then 3, etc. It is on all of the /page/___ that the function breaks.

    It appears to be looking for the second (or Xth) page of search results instead of the first page of search results—and since there are not 12 of them, it reports “No users found”

    I hope that clarifies it. If not, could you please navigate to the page, hit “next” at the bottom of the page and then enter any name (“Rachel” for example) into the search field?

    Thanks again!

    Plugin Author HelgaTheViking

    (@helgatheviking)

    I understand the issue is that when on a page, and you enter a search, you aren’t redirected back to the first page. I’m not yet sure of the solution and am up to my neck with one of my other plugins. I’ll have to think a bit longer about this.

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Could you please trying overriding the search-authors.php template, and changing the form action to the current permalink?

    
    <form method="get" id="sul-searchform" action="<?php echo esc_url(get_permalink() );?>">
    

    That’s how the plugin was originally, but I removed it for some reason I can’t remember. Probably to support use in places that aren’t pages/posts.. and maybe to accommodate folks using lots of $_GET parameters. If you are using it on a page, then it should be fine.

    Thread Starter SpeedOfLike

    (@speedoflike)

    That worked! Thanks so much!

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Awesome! Love it when the solution is easy! In an ideal world, I’d figure out a way to make that the default behavior. But like I said, I removed that code for a reason back in the day, so I don’t want to put it back immediately.

    Saw the kind review you left for the plugin too. Much appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Search not working from /page/2 and so on.’ is closed to new replies.