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 is_paged() function no longer works

Viewing 6 posts - 1 through 6 (of 6 total)
  • Jessica Spata
    #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 Moderator
    #256292

    I think you may need to use something like:

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

    Instead, depending on your code.

    Jessica Spata
    #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 Moderator
    #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
    }
    Jessica Spata
    #256370

    Perfect, thank you!

    Trevor Moderator
    #256374

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

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

The topic ‘is_paged() function no longer works’ is closed to new replies.