I'm trying to create a shortcode that will display the post date +1 day. Example: if the post was published on the 3rd I want a shortcode that will display 4th. I've tried the following but not getting the results I want.
// [nextday]
function displaydate_next(){
return the_time('jS', strtotime('+1 day'));
}
add_shortcode('nextday', 'displaydate_next');
// end nextday date
I think you also need to get the month and year so it can calculate the next day. The below is what you need:
// [nextday]
function displaydate_next(){
$time = get_the_time('jS F, Y');
$date = strtotime(date("jS F, Y", strtotime($time)) . " +1 day");
return date('jS', $date);
}
add_shortcode('nextday', 'displaydate_next');
// end nextday date