Hello,
You might add a function like this to your theme’s functions.php
file:
function my_custom_is_content_released()
{
$release_after = 21 * 86400; // days * seconds per day = total seconds
$post_age = date('U') - get_post_time('U');
if($post_age > $release_after)
return TRUE;
else
return FALSE;
}
Then you might modify your theme template to check if the user has access to the appropriate level OR if the content has been released (i.e., more than 3 weeks has passed):
<?php if ( current_user_can("access_s2member_level1") || my_custom_is_content_released() ) : ?>
<?php // a call to the_content() might go here ?>
<?php else : ?>
<?php // a message showing how to get access or even a redirect might go here ?>
<?php endif; ?>
You could also put that code directly inside the Post content and use a plugin like ezPHP to allow PHP inside the Post, however modifying the theme template would be far easier.