Forums Forums Search & Filter Pro Post Meta Date Range

Viewing 10 posts - 11 through 20 (of 22 total)
  • Anonymous
    #90549

    Should I use input type date range for both dates or date type for each?

    Ross Moderator
    #91164

    Hi Max

    I’m not sure I follow, can you elaborate?

    Thanks

    Anonymous
    #91300
    This reply has been marked as private.
    Ross Moderator
    #92457

    Hi Max

    As I mentioned, I hadn’t tested the code, merely pointed out something you were doing wrong.

    You are adding a custom meta query, to our S&F query which is fine. But I am not able to validate if your meta query is correct or not.

    The sf_edit_query_args should work no problem, so I suggest the problem lies in your code (and possibly the specifics of your meta query).

    Why not create (seperate form all this S&F stuff), create a new WP_Query, with your meta query, and see if produces the desired results?

    https://codex.wordpress.org/Class_Reference/WP_Query

    The first example under “usage” should be fine, provided you set your post type and meta query in the $args.

    Once we know your meta query is correct and working properly we can have a look to see where the above is going wrong (please send me a link of it working).

    Thanks

    Anonymous
    #126386

    Can anyone give me a small example for the folowing? I have two search fields in the form. Both need to get a numebr to search for. But I want to make a calculation with the two: field1 x field 2 and use that also as a search argument.

    Thanks,

    Pter

    Trevor
    #126415

    Peter, it might have been better to start a new thread. If you want me to do that, I can move this, but If you can think of a ‘Title’ for the thread?

    As to the question, this is more complex than I can do. I will mark this for the attention our developer, Ross, to see if he can help, but I cannot promise anything. He will return from vacation shortly.

    Anonymous
    #126441

    Well Trevor, I think it is not that advanced, and I already posted this one somewhere else and I hope to find people who could gave some help.

    I am glad I have the right hook, it is now just about getting the tow meta fields from the searchfields, make a calcuation and use the result in the search.

    I know it is easy to say, but I know I am close to a solution in this thread……

    Thanks,

    Peter

    Ross Moderator
    #129047

    Hi Peter

    Currently you cannot use multiple search fields in a form.

    This is coming in v3.

    There might just be a hacky way to do this using filters etc buy I imagine it would be incredibly fragile and is not something I’ve tried to do before.

    I’m currently working on v3, which is huge update so it is some time away yet.

    Thanks

    Anonymous
    #130914

    Hi Ross,

    Let me explain in detail what I want to do:

    I have two fields in ACF which I use in S&F. That is ‘height’ and ‘width’. Both fields are used in S&F to do the search. Nothing wrong so far and it works.

    However the ‘height’ and ‘width’ fields also represent the surface (height x width). It would be strange if someone fills in the search form with height = 4 width = 2, that you should fill in the surface (8 in this case) yourself. So, the thing I want is some kind of hidden search field, which is calculated out of the requested height and width search field. Is that possible?

    Kind Regards,

    Peter

    Ross Moderator
    #155362

    Hi Peter

    Digging through some really old threads and saw this had slipped through the cracks.

    Just to let you know, this is being worked on for v3 – well, we are going to allow you to create your own fields, so you should be able to achieve something similar to what you describe.

    Best

Viewing 10 posts - 11 through 20 (of 22 total)