Support » Fixing WordPress » Check if post is older than a certain date

  • Resolved Nikolas

    (@kordellas)


    Hello there, I am trying to create an IF statement that I want to check if the date of an article is older than a date I want. I am having some problems though.. any help appreciate.
    I am using j F Y to display the date of the article.

    <?php
          $date1 = "25 09 2009";
          $date2 = the_date('', '', '', FALSE);
    if ($date1 < $date2) {
    $valid1 = "yes";
    echo "$valid1"; } else {
    $valid2 = "no";
    echo "$valid2";}
          ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Check if post is older than a certain date’ is closed to new replies.