WordPress get_lastpostmodified() Function

The get_lastpostmodified() is a WordPress builtin function to get the most recent time that a post on the site was modified. It will return the timestamp in ‘Y-m-d H:i:s’ format.

The server timezone is the default and is the difference between GMT and server time. The ‘blog’ value is just when the last post was modified. The ‘gmt’ is when the last post was modified in GMT time.


WordPress get_lastpostmodified() Function Example #1

Example #2

Reference: https://developer.wordpress.org/reference/functions/get_lastpostmodified/

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.