Hide events/posts if a date from a meta field is in the past

preview_player
Показать описание
If you're a Crocoblock user, this video can be helpful. If you create a custom post type (CPT) that is date/time sensible, such as events, job posts, etc., you want to hide old events or posts past the deadline. This video walks you through how to do it.

Download #crocoblock

Need a new website?
Рекомендации по теме
Комментарии
Автор

You are a king! Thank you for linking me to this video.

MIRAJADESIGN
Автор

Perfect! How do I list the current month instead of the current day? I've tried several ways and it didn't work.

Hericjr
Автор

Another great video. I have a question, is it possible to change a taxonomy after a certain date? Thank you very much

giulianogagliardiify
Автор

This helped a lot, thank you !!!
How can you know the correct macro is 'today' ?

tpimedia
Автор

I think this guide is a good starting point, but it's incomplete in terms of usefulness. What about currently ongoing events? We have upcoming events, but when the event date is the current day, the event disappears. From a usability standpoint, this is not a good solution. So my question is, how can we set up an event that is currently ongoing and display events that are only on a specific day?

Following this line of reasoning further, we should have a query for "upcoming, current, past" events.

CzytajzNami
Автор

Yooo, this helped a lot !
How can you know the macro is 'today' ?? All else I had figured

lnedzzq
Автор

Thank you very much 😍 You are the BEST 🥰

helloweb
Автор

Super useful, thank you for sharing this!

If you were using this for a events CPT where you had both a start_date and end_date to allow for multi day events,
how could you check to see if it showing events that are happening in either now or in the future ...
so where 'end_date is greater or equal to today' and 'start_date is also greater than or equal to today' ...
I guess you would then sort by start_date (ascending) so that events list from today onwards?

Thanks again :)

MrBalloonatic
Автор

I only have "query" but not every others tabs like you (custom query, post query, terms query...). I use Elementor and Crocoblocks too... Do you know where could be the problem ?

rswebmarketing