Adds a shortcode and function allowing you to force the contents of a post or page to appear or expire after a specific date, day and/or time.
If you wish to use this facility elsewhere in your theme - e.g. your sidebar - then you can do by calling a PHP function.
It uses the same parameters as above, each seperated by an ampersand.
This will return either TRUE or FALSE depending on whether the content should be displayed or not. So, a full example may be...
<?php if ( function_exists( 'timed_content' ) ) : ?> <?php if ( timed_content( 'ondate=20120101&offdate=20121231' ) ) : ?> Some content goes here <?php endif; ?> <?php endif; ?>
This will only display the content if it's any date during the year 2012.
If you would like to add a translation to his plugin then please contact me
This WordPress plugin is licensed under the GPLv2 (or later).
Thanks to Jeff Kereakoglow for the
offday suggestions, as well as pointing out the bug with the time.
Requires: 2.0 or higher
Compatible up to: 4.6.2
Last Updated: 5 months ago
Active Installs: 800+
Got something to say? Need help?