Skip Navigation

[Resolved] Search/filter cpt for pubblishing date.

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to create a parametric search filter to filter the posts by their published year.

Solution:

Unfortunately no this isn't possible since a date is an entire number. What i would recommend that you do is to add a year custom field and mark the years in the custom field and then filter by that custom field.

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 6 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#628349

Hello, can I filter the cpt by publication date? In particular I would like to filter by year.
Example All events published in 2017

hidden link

#628497

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Michele,

Thank you for contacting our support forum.

Unfortunately no this isn't possible since a date is an entire number. What i would recommend that you do is to add a year custom field and mark the years in the custom field and then filter by that custom field.

Please let me know if this helps.
Thanks,
Shane