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 Edit Query Arguments and Pagination Problem

Viewing 5 posts - 11 through 15 (of 15 total)
  • Senac São Paulo
    #120468

    Unfortunately It’s impossible to give you admin access because it is running on an intranet server… But I could send you some screenshots of the plugin setup. Even the theme folder, if you think it’s necessary.

    Trevor Moderator
    #120473

    OK, let’s start with screenshots. Maybe you could upload them to a file sharing service like Cloudup and give me a link?

    Ross Moderator
    #120478

    Ah yes I found the issue.

    Its the way you are doing the filter.

    First of all let me say, when you use a WP filter, you usually get an input variable, which needs to be modified (filtered) and its then returned.

    Doing $args = array(), means you replace the input object rather than modify it, for example this would be better:

    $args['property'] = "value"

    Anyway, what it meant was, you were replacing the pagination variable, which had already been conveniently calculated for you 😉

    So, all you would need to do is (notice I left paged off):

    $args['post_type'] = 'tarefa';
    $args['posts_per_page'] = 5;
    $args['order'] = 'DESC';
    $args['author'] = $feed_rc;
    $args['meta_query'] = $feed_cd;

    In fact, now you are using the existing $args, you will find S&F builds a lot of the rest, just because of the settings you have chosen… so this could probably be reduced to:

    $args['author'] = $feed_rc;
    $args['meta_query'] = $feed_cd;

    If you change the order of results in S&F settings this should be retained, as well as posts per page setting and post type 🙂

    Let me know how you get on!

    Senac São Paulo
    #120752

    Hi Ross!

    Thank you very much, I think we are very close to find the solution! Pagination now is working and filtering too, but separately.

    When filters are off, pagination works fine and adds ?sf_paged=2, ?sf_paged=3 to the end of URL. Like:

    http://localhost/comunicacaodigital/minhas-tarefas/?sf_paged=2

    When filters are on, pagination stops (stays on first page)… the pagination link is:

    http://localhost/comunicacaodigital/minhas-tarefas/?_sfm_responsavel_1=47page/2

    I did a test and manually type the URL like:

    http://localhost/comunicacaodigital/minhas-tarefas/?_sfm_responsavel_1=47&sf_paged=2

    And worked!

    So do you have an idea of what I should do now?

    Thanks again!

    Senac São Paulo
    #120881

    Hi Ross,

    I just removed base and format parameters of paginate links function and it worked perfectly.

    Thanks for the support, Ross and Trevor!

    All the best 🙂

Viewing 5 posts - 11 through 15 (of 15 total)

The topic ‘Edit Query Arguments and Pagination Problem’ is closed to new replies.