Forums Forums Search & Filter Pro is_paged() function no longer works

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #256229

    Hi, I’ve discovered that the is_paged() function no longer works on the pages that this plugin is active on, is there a way to reinstate this function? I still use pagination to display the results.

    Thank you!

    Trevor
    #256292

    I think you may need to use something like:

    !isset($_GET['sf_paged']) or isset($_GET['sf_paged'])

    Instead, depending on your code.

    Anonymous
    #256329

    Amazing, this works perfectly, thank you!!

    I’m using it to run a function to offset the number of posts on the first page, but only if the page is outputting the default/unfiltered loop. Is this the best way to check that?

    global $searchandfilter;
    $filtered = $searchandfilter->get(1045)->current_query()->is_filtered();
    if ( !is_admin() && $query->is_main_query() && is_home() && $filtered != 1 ) {
    ...
    }
    Trevor
    #256340

    The code we would normally recommend, so you may need to modify this, or may indeed have used this, is:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1045)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      // the unfiltered posts output code here 
    } else {
      // the current (filtered) posts output code here
    }
    Anonymous
    #256370

    Perfect, thank you!

    Trevor
    #256374

    Thanks for getting back to me. I will close this thread for now.

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