I have an listing of events (made with posts in wordpress) that I have php code snippet that sorts by the event date (ACF), and automatically un-publishes an event on the day after the event date. The problem is a couple categories (live-theater and stage-artists) sometimes have no events listing, so when the case is that the last event in that category auto un-publishes, I need a standby (‘no scheduled event… marketing message… etc.) post in that category to auto publish. It needs to be a post (not code that builds a post dynamically) so the client can change the text/feature image of the standby post as needed.
I’m not a coder, but I think the logic needs to be something like this:
IF category live-theater = 0, then publish “no-live-theater-events-post”
IF category live-theater = 2 or more, then unpublished “no-live-theater-events-post”
I’ve seen that wordpress has a thing called “transition_post_status” that may be the mechanism, but I’m out of my depth putting it all together.
Thanks for any advice.