Skip Navigation

[Resolved] Filtering view by post date (year)

This support ticket is created 4 years, 7 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 5 replies, has 2 voices.

Last updated by Shane 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1826105

As the post title - I have a view created in the block editor and I would like to add filter by year based on the post date. How can I achieve this? Thanks!

#1826203

Shane
Supporter

Languages: English (English )

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

Hi Mary,

Thank you for getting in touch.

For clarity will this be a static filter or is it a frontend filter for users to filter the posts on the frontend.

It's not possible to filter the posts by post date on the frontend, however you can add a filter for the year on the backend filters.

Please let me know.
Thanks,
Shane

#1826225

Hi, I was hoping to be able to have the user filter the front end view. Is this not possible at all?

#1826351

Shane
Supporter

Languages: English (English )

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

Hi Mary,

For the default post date field you're not able to do this.

However if you create a date custom field you are able to add a Frontend Filter for this and the users will be able to filter the posts by this date field.

Please let me know if this helps.

Thanks,
Shane

#1826503

Thanks, that what I was thinking. Would it be possible to auto populate the date field somehow?

#1827249

Shane
Supporter

Languages: English (English )

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

Hi Mary,

Do you mean to get the current date and auto add it to this field ? It would be possible but it would require the use of custom code when creating the posts.

What you can do is to make the field required so users will be forced to fill out the field.

Thanks,
Shane