Expire posts from homepage, but remain published in the archive
I need to show recent news (i.e. posts) on the sidebar of the homepage on a client’s site. There can be several weeks between new posts though (it’s not a super active industry), so I want the post to expire from the homepage after a set amount of time, but still remain on the News (blog) page.
One solution I’m thinking about is to create a tag (“featured” or something like that), then show only posts with that tag on the homepage. Then, after a set amount of time, edit the post to remove the tag to remove it from the homepage.
However, I would prefer to make it expire from the homepage automatically. I’d also like the “Recent News” heading to disappear if there are no posts to display.
I found a tutorial of how to expire posts with custom fields (e.g. basically, create a custom field with a key of “expiration” and a value of date/time with the format mm/dd/yyyy 00:00:00), but this is too technical for the client. I’d rather set the expiration right in the loop so they don’t have to do anything but publish the post.
- The topic ‘Expire posts from homepage, but remain published in the archive’ is closed to new replies.