add an expiration date to your article
February 8, 2010 by admin · Leave a Comment
This hack is very useful when you have a contest on the site. You can put a timeout for an article.
All you have to do is to modify the index.php and change the following code:

<br><br><?php<br>if (have_posts()) :<br>while (have_posts()) : the_post(); ?><br>$expirationtime = get_post_custom_values('expiration');<br>if (is_array($expirationtime)) {<br>$expirestring = implode($expirationtime);<br>}<br><br>$secondsbetween = strtotime($expirestring)-time();<br>if ( $secondsbetween > 0 ) {<br>// For example…<br>the_title();<br>the_excerpt();<br>}<br>endwhile;<br>endif;<br>?><br><br>
after that you must add the field names that have expiration format mm / dd / yyyy 00:00:00
Related posts: