-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
48 lines (40 loc) · 1.08 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* The header for our theme
*
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Four Corners Exhibit
* @since 1.0.0
*/
$page_title = '';
if( $post && $post->post_type == 'page' ) {
$page_title = $post->post_title;
} else if( $cat = get_queried_object() ) {
if( $cat_parent = $cat->category_parent ) {
$page_title = get_term( $cat_parent, 'category' )->name . ': ' . $cat->name;
}
else {
$page_title = $cat->name;
}
}
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<?php wp_head(); ?>
<title>Four Corners Project: <?= $page_title ? $page_title : 'Exhibits'; ?></title>
</head>
<body <?php body_class(); ?>>
<header id="main-header">
<a href="<?= get_home_url(); ?>">
<h3>Exhibits from the</h3>
<h3>Four Corners Project</h3>
</a>
<h3 id="page-title"><?= $page_title; ?></h3>
</header>