• I want to post a whole bunch of posts, one per week. So I’ve added a special postweek.php and a corresponding edit-formweek.php to the admin menu.

    edit-formweek chooses the default date using this code:
    $max_date = ($wpdb->get_var("SELECT MAX(post_date) FROM $wpdb->posts"));

    Which gives me the date of the last post. What I want it to default to, however, is the last post plus seven days.

    Are there any date functions that will do this?

Viewing 1 replies (of 1 total)
  • Thread Starter RobotHero

    (@robothero)

    function rrh_add_days ($date, $days){

    $days_adj = strtotime($date) + $days * 3600 * 24;
    $date = date(‘Y-m-d H:i:s’, $days_adj);
    return $date;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘date functions?’ is closed to new replies.