Skip Navigation

[Assigned] Create a date filter for a repeated number field

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by szymonF 1 day, 22 hours ago.

Assisted by: Minesh.

Author
Posts
#2762976

My site is a repository of philosophy articles.

I want to add a filter which will allow users to filter query results by a custom field called 'publication date' in the search view and in archives. The custom field is a number field. I want the filter to allow the user to enter a date range - ideally in two fields, 'from' and 'to' - and if an article has a publication date within that range, it will come up in the query. For example, an article written in 2013 should come up when the user enters 2000 in the 'from' field and 2020 in the 'to' field. How do I do that?

There is a twist!
Some articles have more than one date. It's because they have different editions or have been republished. On the back end, I simply 'Allow multiple instances of this field'. I would like the filter to find the entry on any of the publication dates. For example, an article written in 1987 that was reprinted in 2013 should come up when the user enters 2000 - 2020, but also when they enter 1950 - 2000. Is this possible?

There is an even worse twist!
Some texts are collections that have been written over a longer period of time. For those, I enter date ranges in the 'publication year' field, for example: 2005-2015. It would be amazing if the filter could find such a text if the search query hits any of the years in the range, e.g. if the user searches for 2000 - 2010, or 2010 - 2020, or even 2007 - 2008. Is this possible?

I am using the original text editor, not the blocks one.

#2763164

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

First of all, I would like to know what plugins you are using and I need to review the content structure you have currently.

Can you please send me details about with what post type you added the date custom field and send me admin access details and let me review your current structure and once I review it, I will be able to guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2765950

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I try to login using the admin access details you shared I got the following error:

Error: The password you entered for the username testadmin is incorrect.

Can you please send me working admin access details.

As well as tell me where you created the repeated number field with what post type.

I have set the next reply to private which means only you and I have access to it.

#2767244

Hmm, that's weird... I just reset the password, it is now:
f88qlPAV2TsLp)@Cabvo7VOR
username the same: testadmin

The custom field is called 'Publication Year' and it's found in the 'Entry details' group. It applies to post type: 'Entry'.

Thanks!