Kindly follow the below steps if you want to display the dynamic year in the copyright section.
Manually you can add a year function
- Step 1 : Get into the file path /wp-content/themes/veda/functions.php paste the below code,
function copyright() { global $wpdb; $copyright_dates = $wpdb->get_results(" SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish' "); $output = ''; if($copyright_dates) { $copyright = "© " . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= '-' . $copyright_dates[0]->lastdate; } $output = $copyright; } return $output; }
- Get into the file path /wp-content/themes/veda/footer.php there you can add the below code,
echo copyright();
Third Party Plugin
You can use the below Automatic Copyright Year plugin to add a current year.
Leave A Comment?