Hot answers tagged

1

Up-voting Andy's answer, you should be comparing integers to get this working. strtotime() can turn any string to the time integer, which will be compared later to tell the difference and how many seconds passed until now ( time() ). Something like follows: $expired = ( ( time() - strtotime(get_the_date('Y-m-d H:i:s')) ) / DAY_IN_SECONDS ) >= 5; if ( $...



Only top voted, non community-wiki answers of a minimum length are eligible