reformat roots_title syntax again
This commit is contained in:
@@ -7,38 +7,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function roots_title() {
|
function roots_title() {
|
||||||
if (is_home()) {
|
if (is_home()) {
|
||||||
if (get_option('page_for_posts', true)) {
|
if (get_option('page_for_posts', true)) {
|
||||||
echo get_the_title(get_option('page_for_posts', true));
|
echo get_the_title(get_option('page_for_posts', true));
|
||||||
} else {
|
} else {
|
||||||
_e('Latest Posts', 'roots');
|
_e('Latest Posts', 'roots');
|
||||||
}
|
}
|
||||||
} elseif (is_archive()) {
|
} elseif (is_archive()) {
|
||||||
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
|
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
|
||||||
if ($term) {
|
if ($term) {
|
||||||
echo $term->name;
|
echo $term->name;
|
||||||
} elseif (is_post_type_archive()) {
|
} elseif (is_post_type_archive()) {
|
||||||
echo get_queried_object()->labels->name;
|
echo get_queried_object()->labels->name;
|
||||||
} elseif (is_day()) {
|
} elseif (is_day()) {
|
||||||
printf(__('Daily Archives: %s', 'roots'), get_the_date());
|
printf(__('Daily Archives: %s', 'roots'), get_the_date());
|
||||||
} elseif (is_month()) {
|
} elseif (is_month()) {
|
||||||
printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y'));
|
printf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y'));
|
||||||
} elseif (is_year()) {
|
} elseif (is_year()) {
|
||||||
printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
|
printf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
|
||||||
} elseif (is_author()) {
|
} elseif (is_author()) {
|
||||||
global $post;
|
global $post;
|
||||||
$author_id = $post->post_author;
|
$author_id = $post->post_author;
|
||||||
printf(__('Author Archives: %s', 'roots'), get_the_author_meta('display_name', $author_id));
|
printf(__('Author Archives: %s', 'roots'), get_the_author_meta('display_name', $author_id));
|
||||||
} else {
|
} else {
|
||||||
single_cat_title();
|
single_cat_title();
|
||||||
}
|
}
|
||||||
} elseif (is_search()) {
|
} elseif (is_search()) {
|
||||||
printf(__('Search Results for %s', 'roots'), get_search_query());
|
printf(__('Search Results for %s', 'roots'), get_search_query());
|
||||||
} elseif (is_404()) {
|
} elseif (is_404()) {
|
||||||
_e('File Not Found', 'roots');
|
_e('File Not Found', 'roots');
|
||||||
} else {
|
} else {
|
||||||
the_title();
|
the_title();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function roots_template_path() {
|
function roots_template_path() {
|
||||||
|
|||||||
Reference in New Issue
Block a user