Skip Navigation

[Resolved] Custom Date Query

This support ticket is created 6 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
- 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 Minesh 6 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#920589

I have a real estate website where i would like to filter the custom posts (properties) to show only the ones that have open home dates (custom field) set to this week.

I've tried to look around existing tickets but was unable to find a good solution. Hope to hear back on this soon. Thanks

#920733

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - do you know we have date filters available which you can use to filter your custom date field:
=> https://toolset.com/documentation/user-guides/date-filters/

However, I would like to know here, when you say current week, for instance, today is wednesday, so you want to consider current week as last Monday to Sunday?

#921007

Hi. Thanks for the link, i've already looked into that section. Yes that is correct the current week is monday to sunday, therefore every week i would like to show posts only with custom date set to before next monday.

#921068

Minesh
Supporter

Languages: English (English )

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

Ok - at this point we need to use view's filter wpv_filter_query .

Where you need to get timestamp of one week by using some custom PHP - see here:
=> hidden link

And then use wpv_filter_query and query the custom date field with start and end time.

If you do not know how to do it, please feel free to share problem URL and access details.

*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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