Site logo

Archived topic

Glitch in post updated date code

12 replies · Started by Deep on May 13, 2019

Viewing posts 1–13 of 13

Hi,
I have followed this article on your site https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date to show the updated date for the posts on my site.
Well, the code is working partly in my case. As soon as I updated the code in the functions.php file it was showing the updated date of the post. But I have an issue in this regard:
After inserting the code, I noticed that the articles which I scheduled for a future date, on publishing the single post pages are displaying the date of preparing the post and not the publishing date.
I think the code mentioned in the article above should display the date of publishing or the date of update whichever is later.
Otherwise for example, if I schedule a post to be published after one week, on publishing it would display a date seven days back of publishing.
Hope you understand my point. Thanks.

Hi there,

So I assume you are using a special plugin or function for schedule updates?

Sorry I am not using any post scheduler plugin. I am simply using the Wordpress post schedule function. Hope you got it.

Hi, I am still waiting for your solution. Thanks

Oops somehow we didn't get a notification for the previous reply.

I've forwarded this to Tom :)

Hi there,

That almost sounds like a WordPress bug. Can you try deactivating your other plugins to rule out a conflict?

Hi Tom,
I tried deactivating all the plugins to check whether its a plugin conflict or not. I found that nothing was interfering and may the code misses some lines.
So far as Wordpress bug is concerned, I would rule out such a possibility. Because prior to using GeneratePress theme I was working on Divi theme where I made such code changes with the support of the technical team to show the post modified date or post publishing date whichever is later in the single post page.
So I think you should have look at the code so that it behaves properly.

See the screenshots
http://prntscr.com/npgwf7 (it shows the publishing date in the WP backend)
http://prntscr.com/npgy36 (it shows the date of creating the post i.e. May 12, 2019 and not the date of publishing i.e. May 13, 2019)

Hope you will resolve the issue soon. Thanks.

I'll see if I can reproduce the issue. I'll get back to you ASAP :)

Hi Tom,
Hope you are working on the problem. I would appreciate if you come up with an early solution in this regard.
Thanks

Hi there,

It's a long weekend here, so I'm away from the main (coding) computer. I'll be back in the office tomorrow morning and will debug this fully :)

Thanks!

Just playing with this now.

After inserting the code, I noticed that the articles which I scheduled for a future date, on publishing the single post pages are displaying the date of preparing the post and not the publishing date.

How are you viewing a post which is scheduled for a future date? Are you previewing it? If so, the function is likely doing the correct thing in showing you the date as it will be once you publish.

Hi,
I haven't got your point. See when I preview a post (that I scheduled for a future date) before publishing it shows the date of creating the post. Before publishing its ok.
But once the post is published, it should show the date of publishing rather than the date of creation of the post (it might be two weeks back from the date of publishing). Hope you would agree with me on this point.

This archived topic is closed to new replies.