How to Automate the Copyright Year

Dec 27, 2024

Updating your copyright year automatically is still simple. Here's how to do it step by step:

1. Navigate to Your Theme Files

Log in to your server or hosting platform using your preferred file manager or SFTP client. Locate your theme's folder. This is typically found at:

application/themes/your_theme/elements/footer.php

or

packages/your_theme_package/themes/your_theme/elements/footer.php

2. Edit the Footer File

Open the footer.php file in a text editor or your IDE. Look for the section where your copyright information is displayed. It might look something like this:

<p>
    &copy; 2023 Your Company Name. All rights reserved.
</p>

Note: the copyright symbol (©) is typically written as &copy; in HTML.

3. Replace the Static Year with Dynamic PHP Code

Replace the static year (2023 in this example) with the following dynamic PHP snippet:

<p>
    <?=t('&copy; %s Your Company Name. All rights reserved. ', date('Y'))?>
</p>

This code automatically fetches the current year using PHP's date('Y') function. The t() function ensures the text is translatable if your site supports multiple languages.

4. Save Your Changes

Save the footer.php file and upload it back to the same location on your server if necessary.

5. Clear your cache and Test Your Changes

Clear your site cache from the Concrete CMS dashboard under System & Settings > Optimization > Clear Cache. Refresh your website and verify that the footer now displays the current year.

Recent Tutorials
Restoring deleted pages using advanced search
Jan 16, 2025
By myq.

How to recover deleted pages when there are more than a few to choose from.

How to Automate the Copyright Year
Dec 27, 2024

Learn how to keep your website's copyright year updated automatically in Concrete CMS.

How to change the path of a group of pages
Dec 23, 2024
By myq.

Change the canonical path without breaking things

Bi-directional Express associations
Dec 18, 2024
By myq.

Set up associations between Express entries in both directions

Display Express Data Across Multiple Sites
Dec 17, 2024
By myq.

A guide to configuring Express entities and the Express Entry List block to ensure proper data display across multiple sites.

Customize locale icons
Oct 29, 2024
By myq.

How to customize locale (language region) flags

Improvements?

Let us know by posting here.