Wordpress Snippet to set Post Expiration time and date


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ***BEFORE LOOP
  2. <?php
  3. $expirationtime = get_post_custom_values('expiration');
  4. if (is_array($expirationtime)) {
  5. $expirestring = implode($expirationtime);
  6. }
  7. $secondsbetween = strtotime($expirestring)-time();
  8. if ( $secondsbetween > 0 ) {
  9. ?>
  10. ***LOOP HERE***
  11.  
  12. ***AFTER LOOP***
  13. <?php
  14. }
  15. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.