1<?php
2function comicpress_copyright() {
3global $wpdb;
4$copyright_dates = $wpdb->get_results("
5SELECT
6YEAR(min(post_date_gmt)) AS firstdate,
7YEAR(max(post_date_gmt)) AS lastdate
8FROM
9$wpdb->posts
10WHERE
11post_status = 'publish'
12");
13$output = '';
14if($copyright_dates) {
15$copyright = "© " . $copyright_dates[0]->firstdate;
16if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
17$copyright .= '-' . $copyright_dates[0]->lastdate;
18}
19$output = $copyright;
20}
21return $output;
22}
23?>