This is the line in question: https://github.com/Automattic/amp-wp/blob/0.7.2/includes/amp-helper-functions.php#L659
Please try to find out what get_the_date( 'U', $post->ID ) is returning.
The issue is also happening down in the post further:
Warning: A non-numeric value encountered in /www/wp-includes/formatting.php on line 3237 49 years ago
So I believe the issue is that your underlying post or page has an empty post_date, or you may have a get_the_date a filter that is causing the problem.
Thanks found this code snippet
function et_last_modified_date_blog( $the_date ) {
if ( 'post' === get_post_type() ) {
$the_time = get_post_time( 'His' );
$the_modified = get_post_modified_time( 'His' );
$last_modified = sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y' ) ) );
$published = sprintf( __( 'Published on %s', 'Divi' ), esc_html( get_post_time( 'M j, Y' ) ) );
$date = $the_modified !== $the_time ? $last_modified . ' | ' . $published : $published;
return $date;
}
}
add_action( 'get_the_date', 'et_last_modified_date_blog' );
add_action( 'get_the_time', 'et_last_modified_date_blog' );
Is there a condition I can use to have this turn off for AMP?
Your snippet should look like this instead: https://gist.github.com/westonruter/428d2bc4c643873d0f476b03fb52f526
It is important to always return a value from a filter and in the case of filtering the date, never modify it if the Unix timestamp (the integer of seconds since 1970) is requested.
Thanks for helping with this, I also found the templates folder in your plugin. Which is perfect since I wanted to change what the text says as well 🙂