-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
55 lines (42 loc) · 1.93 KB
/
Copy pathheader.php
File metadata and controls
55 lines (42 loc) · 1.93 KB
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
49
50
51
52
53
54
55
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package alterego
*/
?>
<!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(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
<!-- firstly check to see if there are any notices, if there are display them -->
<?php if (wc_notice_count()) : ?>
<!-- here we print out oour notices -->
<?php wc_print_notices(); ?>
<?php endif; ?>
<a class="skip-link screen-reader-text"
href="#primary"><?php esc_html_e( 'Skip to content', 'alterego' ); ?></a>
<!-- here we use conditional tags to check whether we are on either the homepage or on a product category page. if we
are, then we are going to show the category nav and featured image -->
<?php if(is_home() or is_product_category()) : ?>
<!-- here we grab the custom field from our category adn display the color and inline style -->
<header id="masthead" class="site-header flex-ns relative" style="<?php echo category_header_background(); ?>">
<?php get_template_part('template-parts/category-navigation')?>
<?php get_template_part('template-parts/featured-image')?>
</header><!-- #masthead -->
<!-- if we are not on a product page, we are going to render out our regular page header -->
<?php elseif (!is_product()) : ?>
<?php get_template_part('template-parts/page-header'); ?>
<?php endif; ?>
<div id="content" class="site-content">