Forums Forums Search & Filter Pro customizing numbers range search

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #264056

    Hello,
    I have a question regarding the numbers range search filter.
    I am using ACF Pro + Elementor Pro and have two custom metas (date-start) and (date-end).
    The retun value of the ACF Pro fields are set to Ymd.
    I have now set the filter to Range-Slider (number) and Auto deteced the min & max vaules.
    It works as it is supposed to. I want to use the “slider” feature.

    But now I want to alter the filter in the way, that it only uses the Y (and ignores the md) value of the fields.
    It will be used for a historic document database, where the user should be possible to filter out a year range, but I need to have the whole date (Ymd) associated with the entry for other display reasons.
    Would it be possible to change the query in a way that it uses only the first 4 values (Y) of the field for sorting?

    Thanks!

    Trevor
    #264080

    There isn’t a direct way to do this, sorry. This thread explains the only current way to do this:

    https://support.searchandfilter.com/forums/topic/filter-by-year-with-date-string-from-acf/

    Anonymous
    #264165

    Hello again,
    Thanks very much! This has worked like a charm. An addition ACF:extended adds a hidden field to the ACF fields, which works perfectly for this use-case.

    One more question:
    I have a ACF taxonomy (hierarchically). There’s one for “exhibition history” and one for “artists history with individual artists”. Both have two pages (elementor with post grid) to show either the documents of the exhibition history or the artist history.

    Right now the numbers slider (dates), set to auto min/max value show all values in the database.
    Would it be possible to make these min-max values for the slider dependent on the posts, which are actually displayed in the grid. I use the S&F “Tags, Categories & Taxonomies” filter to make the first filtering regarding “artists history” & “exhibition history”

    Thanks again!

    Trevor
    #264167

    The way the ranges are calculated, they cannot take into account the posts selected, sorry. This is intentional, as explained here:

    https://support.searchandfilter.com/forums/topic/post-meta-field-values-not-showing-correctly-on-woocommerce-product-categories/#post-257013

Viewing 4 posts - 1 through 4 (of 4 total)