Relative Content

Tag Archive for wordpresspost

WordPress: Auto publish a specific post when its category has no posts

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.