Support » Plugin: Pods - Custom Content Types and Fields » Enabling pods to be searched/filtered?

  • Resolved dustinw

    (@dustinw)


    I’ve created a few fields with pods. Everything is working well, with one exception. Is there a way to enable fields to be searched or filtered?

    Specifically, I have a field that is a date value, I’d like to sort or filter with this field. I’ve experimented a bit with the “Search & Filter” plugin, but couldn’t seem to reference the field I need to with it. Can someone point me in the right direction?

    • This topic was modified 8 months ago by  dustinw.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jim True

    (@jimtrue)

    Did you check out the Search & Filter plugin documentation?

    https://searchandfilter.com/documentation/getting-started/adding-new-fields/

    Specifically, when you add a date as a Custom Field to filter by, from their docs:

    Post Meta (Custom Fields) – Search your post meta – supports number ranges, choice inputs (dropdown, checkbox, multiselect or radio) or dates and date ranges

    That is how you would configure a date filter on a Custom Field added by Pods that is a date field. Select Post Meta, and set it for ‘date or date ranges’.

    @jimtrue Thank you for taking the time to respond. I combed through their documentation and realized this was a “pro” feature. I upgraded to pro and was able to build the form as they suggested including the field I was looking for. However, it doesn’t seem to be working properly. I’m going to reach out to them as well, and see if it’s a configuration issue, as I’m getting no results when I search with the date range.

    Plugin Author Jim True

    (@jimtrue)

    Sounds good. I’ve never actually played with Search & Filter, but didn’t realize that was a pro feature, either.

    Make sure you’ve got an Archive configured for your post-type and that it’s working normally. I don’t know if Search & Filter requires it’s own ‘page’ for that kind of stuff or not. I know FacetWP either uses a separate template for the facet page, or you add it to the archive template.

    @jimtrue , is it possible to modify how the dates are stored in the database from PODS? After speaking with the folks that develop the Search and Filter plugin, they said the dates have to be stored in the YYYYMMDD format. It looks like PODS stores them as YYYY-MM-DD. Is it possible to remove the hyphens?

    Plugin Author Jim True

    (@jimtrue)

    Unfortunately, no, that isn’t possible. Date fields are stored in the standardized way supported by WordPress Post Meta (and Meta Key Queries) which is the yyyy-mm-dd format and yyyy-mm-dd hh:mm:ss for datetime.

    If Search and Filter isn’t using that format, I’m a little surprised. They would probably require a filter on their end to allow searching in a format that is not the standard for date fields in WordPress post meta.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Enabling pods to be searched/filtered?’ is closed to new replies.