• Hello TC,
    Thanks for designing such great plugin for all WP users.
    I would like to seek for your advice. I added custom field (effective start date and effective end date of tickets). How can I set a filter search on date range? For example, user search tickets which are still effective, i.e. effective start date </= today </= effective end date.
    Sorry I am not good at coding. Please advise. Thanks in advance.

    http://ww.wp.xz.cn/plugins/ultimate-wp-query-search-filter/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TC.K

    (@wp_dummy)

    It’s a bit tricky to query date.
    The easiest way is store your date value in number format by using php strtotime() when saving your date,then you can directly using ‘>’ or ‘<‘ for the filter field. But remember, the options of the field you got to manually change the value back to date format by using php date() function.

    Thread Starter ckw123

    (@ckw123)

    Thanks very much, TC. I will try to figure out though I am a basic user.

    Hello. Your plugin seems to be perfect for me, but I need also to filter all custom post types between a startdate and an enddate (daterange). I read the solution you gave to ckw123 but I don’t understand why using the ‘ or ‘ for filtering. The filter should be ‘from’ a date –> ‘to’ another date. Could you kindly explain me more? Thank you.

    Plugin Author TC.K

    (@wp_dummy)

    The > or < can be used for From or Before.

    For from –> to, you can use Between instead.

    Cool, thanks! Where could I find a list of choices (from, before, or, between … others)?

    Plugin Author TC.K

    (@wp_dummy)

    It is on the meta field section where you choose the Compare select field

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

The topic ‘Date Range filter’ is closed to new replies.