Loop – Hide every year old post

I’ve had an interesting inquiry from management for a client site I built (using additional themes from Elegant Themes) and a school. At the beginning of each September, when the school starts a new academic year, they would like it if dynamically populated modules (such as tabbed posts, post carousels and blog grids) were empty and showed no content from the previous academic year Were were But we don’t want to get rid of ‘old content’ (content from before 1st September) so if you need to search for it and find it it should still be able to show up after you find it. I found a really old plugin that provided what we needed but I didn’t dare to install it (https://wordpress.org/plugins/hide-old-posts/). It needs to be a global function rather than a setting in each post. I need to write a function filter that does the following: while displaying posts loop in date order (in carousel, blog grid or tabbed posts), only display content from 1st September when each year reaches 1st September (that year) for the next full year. Does this make any sense? Can this be possible?

Leave a Comment