Skip Navigation

[Resolved] Help on conditional date lag test

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 5 replies, has 2 voices.

Last updated by nicolaS-3 1 year, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2659513

Hi,
in a classic view template I'd like to show a message warning the post author that this post hasn't been updated for three months, but I cannot set the right conditional. I thought to use [wpv-post-date type="modified"] but in the conditional window WP standard post fields aren't listed. I could edit the condition manually, but how to test something like " if TODAY - [wpv-post-date type="modified"] > 90 " ?
Also, how can I set the same conditional in the block editor to filter out older posts ?
thanks
Regards
Nicola

#2659559

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like to know that do you want to only display the posts whose modified date is greater than 90 days from todays date? or you want to display all post but when a post falls in category whose modified date is greater than 90 days then you want to display some message?

#2659601

Hello Minesh,
On the archive page (list of all posts, block editor) I'd like to add a filter to hide all posts older than 90 days.
I apologise for confusing conditional with filter, later I tried to use the Post Date filter, but I was't able to find a good one, I tried: modified date before Month LAST_ONE =3, but it didn't work. Please suggest.

Also, on the "My posts" page listing all current user's posts (classic view) I'd like to show a message for each post older than 90 days so that the user know that the post is hidden and needs a refresh or deletion.
thanks
Regards
Nicola

#2659893

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL and admin access details and let me review how you added your query filter.

*** 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.

#2660307

Minesh
Supporter

Languages: English (English )

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

Can you please check now.

I've added the following query filter to your archive's QUERY FILTERS section:

Select posts whose
Modified date is equal to: year:CURRENT_ONE()
AND
Modified date belongs to a month between those: PAST_ONE(3),CURRENT_ONE()

Can you please confirm it works as expected.

#2660717

Hi Minesh,
it seems to be working,thanks !
Please have somebody to write a guide about how to use this filter, it's pretty complex to understand.
Thanks
Regards
Nicola