Crocoblock Listing Grid Date Filters

Short Answer
Want to show your cpts based on a date field that you have inserted? after you have created the meta fields in your cpt with date type and flag on the “save as timestamp” In the listing widget -> post querty -> meta query -> insert your meta field slug -> operator: between -> value: “today, first day of next month” and change the “Type” down below to date

One would think that filtering on dates would be complicated and you would need to know the official date formats etc.

Once again Wordpress suprised me. Apparently you can use simple words for this.

If you want to filter only for this month for example, choose the operator “between” and then you can add “today, first day of next month” in the value field. WHHAAATTT???

If you want this weeks posts: Operator=Between and Value “last Monday, next Monday”

Do you want only today’s post? Operator=Equals and Value “today”

Only from today and future? Operator=Greater or Equal to and Value “today”

Want to only show your current events? Try out: ID: start-date | Operator: Equal or less | Value: today AND (add a new meta query) ID: end-date | Operator: Greater or equal | Value: today

Remember, in all cases you have to choose the “VALUE TYPE” (the one down below) as DATE


Questo sito fa uso di cookie per migliorare l’esperienza di navigazione degli utenti. Può conoscere i dettagli consultando la nostra privacy policy qui. Proseguendo nella navigazione si accetta l’uso dei cookie; in caso contrario è possibile abbandonare il sito.