• I know how to display a custom field. I just use the code shown here:

    $customField = get_post_custom_values("new");
    if (isset($customField[0])) {
        echo "New: ".$customField[0];
    }

    What I need to know is how to make that code display on only a certain date and then have a different custom field display if it isn’t that date.

    Say that I want the code above to show on December 14, but on December 15 I want this code to be used instead:

    $customField = get_post_custom_values("previous-post");
    if (isset($customField[0])) {
        echo "Previous Post: ".$customField[0];
    }

    How would I do that?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional custom field based on time’ is closed to new replies.