Showing the current year
To show the current year in WordPress posts, follow these steps:- Log in to WordPress as the administrator.
-
On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor:
- In the right sidebar, under Theme Files, click Theme Functions (functions.php).
- Copy the following code snippet and then paste it at the bottom of the functions.php file:
- Click Update File. WordPress saves the changes to the functions.php file.
-
The current year functionality is now enabled, but you must update the post or posts where you want it to appear. To do this, open a post or page on the site, and then type
[year]where you want to display the current year. For example: