Way to show or hide query based on number of days its been posted

Hi Cwicly community!

I came across some project and was building a automate ‘Trending’ section of my website, where I have query that is show based on the number of likes that post gets from a custom field.

Now I want the query to show only the post that is fresh, so if the post is posted a week ago, I want the query to exclude them. Is there a possible way to do it with Cwicly query setting or it is currently not possible?


Hi @lukelee,

Cwicly Query has a Date Query that may help you with this.

It may be possible to create a dynamic field in ACF that returns the earliest date relative to the current date that you want posts to be returned for.

You can then use the dynamic aspect of the query date fields to reference this field.

If that doesn’t give you what you need, then perhaps @Louis or @Araminta can suggest something better.

Hi @StrangeTech , thanks for this solution! @Louis already pointed me out on the Facebook community where I’m using the Cwicly’s filter from the documentation to hardcode a function to achieve what I was looking for.