public static function get_date_for_title()
{
// If archive year, month, and day are specified.
if (is_day()) {
return get_the_date();
}
// If archive year, and month are specified.
if (is_month()) {
return trim(single_month_title(' ', false));
}
// Only archive year is specified.
if (is_year()) {
return get_query_var('year');
}
return '';
}