Skip Navigation

[Resolved] filtering CPT by Repeating Field Group AND category (part II)

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2575395
Screenshot 2023-03-17 144259.png
Screenshot 2023-03-17 144117.png

Thank you so much for the code you shared in response to this thread: https://toolset.com/forums/topic/filtering-cpt-by-repeating-field-group-and-category/

I have tried to replicate this functionality on my site but when I input a date into the date filter, it always comes up with zero results.

Also, I noticed when using the sandbox site you created, hidden link when I input a date into the filter, it often shows events that have passed (see screengrab) Interestingly, it seems when you choose a date for which an exact match exists, it will properly filter only those events. However if no exact match occurs, it will show all results unfiltered.

Is it possible to show only events which contain a date after the given search parameter?

#2576609
date-filter-5.jpg
date-filter-5.jpg

Hello,

You will need to change the date field filter of parent post view.

See the sandbox website:
Login URL:
hidden link

Edit the parent post view:
hidden link

In section "Search and Pagination", click into date field filter shortcode:
[wpv-control-postmeta field="wpcf-event-dt" type="date" url_param="wpv-wpcf-event-dt"]
click button "Edit filter" button, change the filter as screenshot date-filter-5.jpg

Test it in frontend, for example:
hidden link

It works fine