I am looking to display different content after a user registers. Is there a way to find out the registration date and then if it’s been 1 day display one thing, but if it’s been 2 days display something else?

Something like this, but based on the registration date and not a post entry date:

<?php if (strtotime($post->post_date) > strtotime('-30 days')): ?>
   //Text for posts created in the last 30 days
<?php endif; ?>

2 Answers
2

Yes you can!

<?php 
get_currentuserinfo(); 
$user_data = get_userdata($user_ID);
$registered_date = $user_data->user_registered;
if (strtotime($registered_date) > strtotime('-30 days')){
   //Text for users registered in the last 30 days
}
?>

hope this helps

Tags:

Leave a Reply

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