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
Edit domains and sitemaps
Apr 4, 2025
By myq.

How to create a sitemap when using an edit domain

Block Types and CIF Data
Apr 2, 2025
By mlocati.

This tutorial describes how Concrete works with blocks data, and how you can create custom block types that works well when exporting and importing data with the CIF XML format.

Customize the default page title
Mar 12, 2025

Change the default " :: " and/or "site name :: page title" formatting separator to something else.

Configure Composer to work with a Page Type
Feb 20, 2025
By myq.

Fix the "Unable to load block into composer. You must edit this content from within the context of the page." error message

Permissions for editors in a multilingual site
Feb 2, 2025
By myq.

How to set up a multilingual Concrete CMS site for groups of language-specific editors

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.

Improvements?

Let us know by posting here.