Skip to content

Commit

Permalink
Fixed missing page titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbohacek committed May 11, 2018
1 parent ec976b9 commit ea7d7e1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
// $page_title = 'Posts labeled ' . single_cat_title();
$page_title = 'Posts labeled #' . $wp_query->query_vars['category_name'];
}
elseif ( is_post_type_archive() ) {
$post_type = $wp_query->query['post_type'];
$page_title = 'Browsing all ' . $post_type . 's...';
}
elseif ( is_author() ) {
$author_id = get_query_var('author');
$nickname = get_the_author_meta('nickname', $author_id);
Expand Down Expand Up @@ -75,6 +79,11 @@
$page_title = "Posts tagged #" . implode( ' #', $tags );
$page_thumbnail = get_the_post_thumbnail_url( (int)get_option( 'page_on_front' ) );
}
elseif ( is_tax() ) {
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$page_title = "Posts tagged #" . $term->name;
$page_thumbnail = get_the_post_thumbnail_url( (int)get_option( 'page_on_front' ) );
}
elseif ( is_archive() ) {
global $wp_query;
$page_title = str_replace( 'Archives:', '', get_the_archive_title());
Expand Down

0 comments on commit ea7d7e1

Please sign in to comment.