As a web developer I often face challenges that you would think would be easy. In traditionally coded HTML, it is simple, but when using a CMS like WordPress it isn’t always like that. WordPress offers a simple interface however that works for most clients!
If you find yourself trying to auto update the copyright year in the footer then this tutorial is for you!
Simply follow the steps below:
- Log into your WordPress site
- Go to “Plugins”
- Search for “Insert PHP Code Snippet” Personally I like using this script, https://wordpress.org/plugins/insert-php-code-snippet/
- Install and activate this script
- In the left column look for and click on “XYZ PHP Code”
- Click on “Add New PHP Code Snippet”
- Enter a tracking name
- Typically I use:
- footer-copyright
- In the next section you’ll need to enter the following code:
- echo date(“Y”);
- Click “Create”
- You will now be given a shortcode something similar to:
- Copy this short code and go to your widget section
- Appearance > Widgets
- Go to your footer widget
- Add a “Text” widget
- Type something like “Copyright &Copy; 2013- *insert shortcode here*” Changing 2013 to the year of your first site
- Update your page, and check. Now the date should be dynamically changing.
Recent Comments