Have you ever seen, some time website has Copyright on the footer? Example on WordPress Tricks Copyright © 2010 – WordPress Tricks & Tips is proudly powered by WordPress, On this tutorial I will show you How to Create and Display a Dynamics Date Copyright in WordPress. All need to do only writen a functions in your theme functions.php and use Add Filter or manually insert code on your footer.

How to Display a Dynamics Date Copyright
Write down Dynamics Date Copyright function below
<?php // display range of dates for copyright @ WPTricks.net function do_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 "); if($copyright_dates) { $copyright = "Copyright © " . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= '-' . $copyright_dates[0]->lastdate; } echo $copyright; } } add_filter('wp_footer', 'do_copyright'); ?>
On the code above the functions will be added automatically on your wp_footer(), but if you want manually added, just remark add_filter function and add manually do_copyright() in your footer.php. Thanks for DigWP to share this code and we hope tutorial to display a dynamics date range copyright work on you…



This collection shows just how versatile wordpress is thanks to the imagination of many designers
Pingback: The Creative Solution to Insert Google Analytics on WordPress | WordPress News Wire