Site logo

Archived topic

Modified Date showing as date in past (Before posted date)

3 replies · Started by Marko on October 26, 2020

Viewing posts 1–4 of 4

I have an issue in which I'll write up my posts on Saturday and schedule them for the week.

The post_modified_date shortcode to use in the GP header seems to be looking at that specific date, instead of the date it got posted as the time it was last updated (Which is how it should be)

This is my code snippet for PHP:

function post_modified_date() {
    return get_the_modified_date();
}
add_shortcode( 'modified_date', 'post_modified_date' );

I then end up with the following:

<meta property="article:published_time" content="2020-10-16T09:30:03+00:00" />
<meta property="article:modified_time" content="2020-10-12T01:54:05+00:00" />

I would assume that it being posted, is a time it was last updated, eg. "modified" so shouldn't the modified_time show the same as the published_time until such time that I update the post again, then the modified date would change which is what I would expect.

Is this not how it works? And if not is there anyway to achieve it? It seems rather odd that it would use a modified date at a time that the post didn't even exist to the public on the website (Only admin backend)

Thanks guys.

Hey David,

Sorry for the late reply - was waiting for one of the scheduled posts to kick off.

But that worked just fine mate, appreciate your help heaps!

Cheers.

Awesome - glad to be of help.

This archived topic is closed to new replies.