AMP "Invalid Structured Data" Due to UNIX Timestamp on Comments?

Posted in: Newspaper
Post count: 2

All my AMP posts with comments are returning an error for invalid structured data. Looking into it using the Google Structured Data Testing Tool, it has an issue with this part of each comment:


<time itemprop=”datePublished” datetime=”1577666657″>December 29, 2019 at 6:44 pm</time>

The error says:

datePublished 1577666657 (Cannot understand the value 1577666657 as a date/time. Learn more about date/time formats.)

Digging more, it seems that the “1577666657” is a UNIX timestamp, which AMP doesn’t seem to like. In the “comments.php” section of the Theme Editor, I see a couple of references to this timestamp:

Line 129: $td_article_date_unix = @strtotime(“{$comment->comment_date_gmt} GMT”);
Line 138: <time pubdate=”<?php echo esc_attr( $td_article_date_unix ) ?>”><?php comment_date() ?> at <?php comment_time() ?></time>

Is there a way to adjust this (or other code) to fix the warning in the structured data?

Post count: 18283

Hello !

Please contact us via email at contact@tagdiv.com and provide the following:

– admin url and credentials
– cPanel url and credentials
– A link to this topic in order to identify you

Our team will take a look !

Thank you !

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.