I’ve built a wordpress site for artwork and would like to set it up so I can create a custom field in the admin that users can select and will display “new” on the front end. Creating this is pretty simple but I would like to “new” to expire after thirty days. Any ideas on setting up the expiration part would be much appreciated.
Leave a Reply
You must be logged in to post a comment.
Assuming you currently have a custom post type archive template (by default, if your custom post type is named “artwork” it would be
archive-artwork.php
, you could create a check for the date it was published usingthe_date()
function like so: