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>'; }}
- WordPress Security – Why Updates and Security Measures are Crucial? - 19 March 2023
- WordCamp Poland 2023 Gliwice – WordPress user conference - 28 February 2023
- How do I restore a previous version of WordPress when an update has failed? - 9 January 2023
Leave a Reply
Want to join the discussion?Feel free to contribute!