[ad_1]
i need help,
Depending on whether a post has been edited or is created for the first time, I would like to take a different action.
My goal is to display the date of the post was created ( $published_date ) , if it was only published for the first time and was never updated or edited.
and to display the updated date if a post was updated/edited ($update_date).
but it seems my code isn’t working, Here is my code.
$published_date = get_the_date( 'F j, Y' );
$update_date = get_the_modified_time( 'F j, Y' );
if( get_the_modified_time() == get_the_time()){
echo $published_date;
}
else{
echo $update_date;
}
}Thank you.
- This topic was modified 2 hours, 36 minutes ago by .
