Skip to content

Commit

Permalink
Merge pull request #1235 from roots/archive-titles
Browse files Browse the repository at this point in the history
Use get_the_archive_title
  • Loading branch information
retlehs committed Dec 18, 2014
2 parents 53f2269 + 4f26c81 commit 3bfc0ee
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/titles.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,7 @@ function roots_title() {
return __('Latest Posts', 'roots');
}
} elseif (is_archive()) {
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
if ($term) {
return apply_filters('single_term_title', $term->name);
} elseif (is_post_type_archive()) {
return apply_filters('the_title', get_queried_object()->labels->name);
} elseif (is_day()) {
return sprintf(__('Daily Archives: %s', 'roots'), get_the_date());
} elseif (is_month()) {
return sprintf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y'));
} elseif (is_year()) {
return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
} elseif (is_author()) {
$author = get_queried_object();
return sprintf(__('Author Archives: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
} else {
return single_cat_title('', false);
}
return get_the_archive_title();
} elseif (is_search()) {
return sprintf(__('Search Results for %s', 'roots'), get_search_query());
} elseif (is_404()) {
Expand Down

0 comments on commit 3bfc0ee

Please sign in to comment.