Home / Widgets / Add dynamic copyright year (center) to footer
Duplicate Snippet

Embed Snippet on Your Site

Add dynamic copyright year (center) to footer

This shortcode will automatically add "Copyright © 2024" (or the current year) to the bottom of the page.

Code Preview
php
<?php
// This will output "Copyright © 2024" (or the current year) in the footer automatically. 
$copyright = "Copyright &#169 " ;
$current_year = date( 'Y' ) ; 
$copyright_year = $copyright . $current_year ;
// Add CSS classes for styling. For example,  
// .center{text-align: center; color: currentColor;}
// Add <center> tag for the text to be aligned center. 
echo '<span class="copyright center">', "<center>", $copyright_year, "<center>", "</span>";
// Use the style.css file for more complex styling. 

Comments

Add a Comment