Expiring certain function automatically on a date in the future

To expire a function in the future just add the following snippet into functions.php file:

add_action( 'loop_start', 'expire_function' );
function expire_function() {
if(time() <= strtotime('10-02-2013') && is_singular('post') ) {
echo'<div class="expire-function">Ohh my gosh I'm expiring!</div>';
}}

 

post
Mariusz Szatkowski
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *