Issues when using hook for arguments

Forums › Forums › Search & Filter Pro › Issues when using hook for arguments

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #200503

    Hey Trevor,

    Thanks for trying to help me this am. I have implemented the hook in functions php but it has brought on other issues now.

    Issue #1 –
    Current page is not recognized. So when you click page 2, it does bring load page 2 via ajax but the “current” class is not applied to the number 2 in pagination. So “1” is still treated as the current page from css standpoint thus to the user it looks like they are on page 1.

    Issue #2 –
    The goal is for the homepage to display shows today and in future. But for the user to be able to search for all shows past and present. This is how I successfully had it set up at first. When using the below function, yes the homepage only displays shows in the future when you initially load the page but it also makes it so you can not search shows in the past. Again, the goal is for home page to display today and future shows but for the user to be able to search both past and future.

    function include_exclude_search_filter( $query_args, $sfid ) {

    `//if search form ID = 1113, the do something with this query
    if($sfid==1113)
    {
    //modify $query_args here before returning it
    $query_args[‘meta_query’] = array(

    ‘relation’ => ‘AND’,

    array(
    ‘post_type’ => ‘show’,
    ‘posts_per_page’ => 12,
    ‘max_num_pages’ => 99999,
    ‘meta_key’ => ‘show_date’,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘meta_value’,
    ),
    array(
    ‘key’ => ‘show_date’,
    ‘compare’ => ‘>=’,
    ‘value’ => $today,
    ),
    );
    }
    elseif($sfid==1234)
    {

    }

    return $query_args;
    }
    add_filter( ‘sf_edit_query_args’, ‘include_exclude_search_filter’, 20, 2 );`

    Anonymous
    #200505

    and sorry the value for ‘value’ is listed correctly below:

    ‘value’ =>current_time('Ymd'),

    Trevor
    #200519

    On the second point, I don’t see any way around that. I have thought about various ways to do it, but none will work.

    I looked at the shows page, and that doesn’t have this current page issue, so what page is that on?

    Anonymous
    #200527

    Thanks Trevor – the second point is very important to what I am trying to build so I guess I will need to stay with using an archive page. At the moment, the archive page method is working perfectly for what I need it to do. I know its probably luck as you mentioned lol but I will just roll with it for now. In that case, sticking with the archive page method also relieves the first issue of existing as well 🙂 So all good.

Viewing 4 posts – 1 through 4 (of 4 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.