Skip to content

Commit

Permalink
[ 仕様変更 ] 投稿タイプアーカイブのアーカイブタイトル名表示部分仕様変更
Browse files Browse the repository at this point in the history
  • Loading branch information
kurudrive committed Dec 1, 2020
1 parent b1a2eb3 commit b95e4fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function lightning_get_the_archive_title() {
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = sprintf( __( 'Author: %s', 'lightning' ), '<span class="vcard">' . get_the_author() . '</span>' );
$title = get_the_author();
} elseif ( is_year() ) {
$title = get_the_date( _x( 'Y', 'yearly archives date format', 'lightning' ) );
} elseif ( is_month() ) {
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$page_for_posts = lightning_get_page_for_posts();
// Use post top page( Archive title wrap to div ).
if ( $page_for_posts['post_top_use'] || get_post_type() !== 'post' ) {
if ( is_year() || is_month() || is_day() || is_tag() || is_author() || is_tax() || is_category() ) {
if ( is_year() || is_month() || is_day() || is_tag() || is_tax() || is_category() ) {
$archiveTitle = get_the_archive_title();
$archiveTitle_html = '<header class="archive-header"><h1 class="archive-header_title">' . $archiveTitle . '</h1></header>';
}
Expand Down
4 changes: 3 additions & 1 deletion template-parts/page-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// Use post top page( Archive title wrap to div )
if ( $page_for_posts['post_top_use'] ) {
if ( is_category() || is_tag() || is_author() || is_tax() || is_single() || is_date() ) {
if ( is_category() || is_tag() || is_tax() || is_single() || is_date() ) {
$pageTitTag = 'div';
} else {
$pageTitTag = 'h1';
Expand Down Expand Up @@ -46,6 +46,8 @@
$pageTitle = sprintf( __( 'Search Results for : %s', 'lightning' ), $bbp_search );
} elseif ( is_404() ) {
$pageTitle = __( 'Not found', 'lightning' );
} elseif ( is_author() ) {
$pageTitle = get_the_archive_title();
} elseif ( is_category() || is_tag() || is_tax() || is_home() || is_author() || is_archive() || is_single() ) {

// Case of post type == 'post'
Expand Down

0 comments on commit b95e4fe

Please sign in to comment.