In this tutorial, we are going to see the Method to Display the Last Updated Date of Your Posts in Ghost CMS.
We already explained the advantages of displaying last updated Post Date in our Previous Guide.
Display the Last Updated Date of Your Posts in Ghost CMS
- Login to your server in FTP
- Open the Ghost Installed Directory Example Mine on
/var/www/Awtsblog
- Open the Folder that you install your Ghost blog
- Next Goto Content > themes
- Open your Current Theme Folder (Active Ghost theme)
- Open
post.hbs
(PS: Code structure will differ on some Ghost themes) I Modified My Custom developed Ghost theme - Find the below on lines your theme
- By default, this Format is used to display Date on Ghost blog Posts
<time datetime="{{date format='YYYY-MM-DD'}}">{{date format="DD MMMM YYYY"}}</time>
OR
<time datetime="{{date format='YYYY-MM-DD'}}">{{date published_at format="DD MMMM YYYY"}}</time>
- Replace this two
{{date format='YYYY-MM-DD'}}
–{{date format="DD MMMM YYYY"}}
Date formatting helper with Below format
<time datetime="{{date updated_at format='YYYY-MM-DD'}}">{{date updated_at format="DD MMMM YYYY"}}</time>
datetime="{{date format='YYYY-MM-DD'}}"
todatetime="{{date updated_at format='YYYY-MM-DD'}}"
{{date format="DD MMMM YYYY"}}
to{{date updated_at format="DD MMMM YYYY"}}
- in most of the ghost themes, developers create a separate Partial File or Post meta’s for an index, tags, and author pages if you Find the Meta tags on that pages Just Replace the Published Date Helper to Updated Post Date Helper
- After all, Modifications save the Files & login your server via SSH
- Restart Ghost and Nginx
ghost restart sudo service nginx restart
- Now check your Ghost blog it will Display the Last Updated Date of Your Posts
learn About Ghost Date Formats – Ghost Date Helpers Docs
From the Editor’s Desk
Hope this tutorial Will Help you to Display Last Updated Post in your Ghost blog Posts.if you have any doubts on this topic Just drop your Comments I will Guide you.
How to Ghost Guides
- Install Ghost on Ubuntu
- SMTP Mail Configuration for Ghost
- Add a Disqus Conditional Load Comments on Ghost
Thanks!
Your feedback helps us improve Allwebtuts.com