Skip to content

Commit aade035

Browse files
committed
show different titles in the top header for archives and searches
1 parent dcfa0c7 commit aade035

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

header-top.php

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
<?php
2-
if ( !is_archive() ) {
3-
?>
4-
<div class="book-header" role="navigation">
5-
<!-- Title -->
6-
<h1>
7-
<i class="fa fa-circle-o-notch fa-spin"></i>
8-
<a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a>
9-
</h1>
10-
</div>
11-
<?php
12-
}
1+
<div class="book-header" role="navigation">
2+
<!-- Title -->
3+
<h1>
4+
<i class="fa fa-circle-o-notch fa-spin"></i>
5+
<?php
6+
if ( is_singular() ) {
7+
?>
8+
<a href="<?php the_permalink(); ?>" >
9+
<?php the_title(); ?>
10+
</a>
11+
<?php
12+
} else if ( is_search() ) {
13+
?>
14+
<a href="<?php echo esc_url( get_search_link() ); ?>" >
15+
Search for: "<?php echo esc_html( get_search_query() ); ?>"
16+
</a>
17+
<?php
18+
} else {
19+
?>
20+
<a href="#">
21+
Archive
22+
</a>
23+
<?php
24+
}
25+
?>
26+
</h1>
27+
</div>

0 commit comments

Comments
 (0)