WordPress Future Events and Countries

I have set up a custom post type called ‘events’ with a taxonomy called ‘countries’.

The Events have an advanced custom field which is a date picker, this is used to determine the end date of the event. Once this date has passed, the event should no longer appear on the front end, which I have managed to do using an if statement.

Read More

The issue lies with the Countries taxonomy. Even with the events not showing on the front end, the taxonomy terms are still displaying even if they have no related posts in the future.

If someone could please help me with this it would be GREATLY appreciated, I have been trying to get my head around this for days!

Let me know if you need any further info!

Related posts