Last Updated Date instead of Published Date

Posted in: Newsmag
Post count: 23

Hi,
I want to show the last updated date instead of the published date for all my posts. What’s the proper way to do it, I appreciate if you can show me exactly where and how I have to modify.
Thanks

Post count: 6600

Hi,

You can sue this solution: https://forum.tagdiv.com/topic/add-time-to-post-including-time-last-modified/ and add the <p>Last modified: <?php the_modified_date(); ?></p> into your post template where you want it to appear and on which post template you want it then use css to style it and set the format setting (e.g. F j, Y) from Administration > Settings > General.
Hope this helps!

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 7

It should be added to the theme for news website, posts get updated, also its a shema.org code standard for updated posts ! its a must for all news website, a theme developper have to deal with shema.org its very important.

Post count: 6600

Hi,

Thank you for your suggestion. I have already added this on our feature requests list and we consider it fro future updates.

Thanks for the message!

Post count: 23

Thanks,
I look forward to future updates then. This is an important feature and I really hope it will be added soon.

Post count: 23

Hi,
I haven’t seen the feature in the new update.
Could you tell me exactly where I should replace the code? I tried but it is not showing correctly. My site is at http://www.techwalls.com/
Thanks

Post count: 7909

Hi,

You can edit loop-single.php (for default post template) and add the code like this: http://screencast.com/t/FFe9618uRBt
Please make sure that you check for this changes to the same post template you are also doing this changes as there are 8 different post templates besides the default one and you need to make this changes to each post template file if you want this on every post template.

Please use this custom css:


.meta-info p {
display: inline;
}
header time {
margin-right: 20px !important;
}

Result: http://screencast.com/t/b4RagDyN7p

Thanks!

Post count: 23

It is showing the last updated date now but Google is not displaying it correctly. I published a post today and when it is indexed by Google, it says 2 days ago. How can I fix it?

Post count: 6600

Hi,

Please make sure you also test this without any plugins and give it some time so that google reindexes that post if you still have the issue please provide a link to a post that has this issue so we can have a look.
Also use http://pastebin.com/ to paste the code of the file you’ve modified.

Thanks

Post count: 9544

Also note that Google News gets the last updated time from the XML news sitemap and not from the page itself, if that matters to you.

The main Google ‘bot should be getting ‘last updated’ from your main XML sitemap also; so good idea to check that is being properly added to the sitemap (eg., via Yoast SEO, or similar).

Post count: 51

Hi, buddies,

I’m using this function on my child-theme successfully a long time, but I don’t know where I can insert it on loop-single-2, loop-single-3, loop-single-4, loop-single-5 and loop-single-6 files.

Could you help me?

Post count: 23312

Hello Ramon Davi,

If you want to change the format of your date, you should edit the single template file where the date is called. The function which creates this is get_date. You should replace it with your function, clear all your caches and check the results.

Thanks for your understanding!

Post count: 51

Hi,

I’ve already done it, but the “get_date” function there’s only on loop-single.php (default), loop-single-1.php, loop-single-7.php and loop-single-8.php files. So, where I could replace it on them?

Regards!

Post count: 23312

Hello Ramon Davi,

For more information about how you can change the actual date format of your theme, please check the following topic here -> https://forum.tagdiv.com/topic/how-to-make-this/ because there I explained how this customization can be done.
So, if you want to display any others levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer or developer to help you because we cannot provide custom services at the moment, sorry!

Thanks for the message!

Post count: 51

Hi, Catalin,

thanks for the link! I found the correct place for inserting the code. So everything is solved now! 🙂

Thanks for your understanding!

Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic.