Edit Query Arguments and Pagination Problem

Forums › Forums › Search & Filter Pro › Edit Query Arguments and Pagination Problem

Viewing 5 posts – 11 through 15 (of 15 total)
  • Anonymous
    #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
    #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!

    Anonymous
    #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!

    Anonymous
    #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)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.