You might have wondered how to display the date of a post on a page by using the Date Format settings. Date Format settings can be found in “General Settings”.
Like always, I like creating a function for this as it cleans up my template quite a bit. This also means I can re-use the code over and over again.
Open functions.php and add this to the end of the file:
Now anywhere in your theme you can get the date posted without dealing with the date format. All you need to do is type this: