***PUT THIS INSIDE THE LOOP, FIRST THING***
<?php //to check against expiration date;
$currentdate = date("Ymd");
$expirationdate = get_post_custom_values('expiration');
if (is_null($expirationdate)) {
$expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP;
} else {
if (is_array($expirationdate)) {
$expirestringarray = implode($expirationdate);
}
$expirestring = str_replace("/","",$expirestringarray);
} //else
if ( $expirestring > $currentdate ) { ?>
***THEN PUT THE FOLLOWING LINE AT THE VERY END OF THE LOOP***
<?php } //end if for expiration; ?>
WordPress post expiration code
Leave a Reply
You must be logged in to post a comment.