-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
196 lines (183 loc) · 6.65 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
/**
* The header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package Designfly
*/
?><!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="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site grid-wrapper">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'designfly' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<?php
if ( get_theme_mod( 'custom_logo' ) ) {
the_custom_logo();
designfly_site_title( 'screen-reader-text' );
} else {
designfly_site_title();
}
designfly_site_description();
?>
</div><!-- .site-branding -->
<nav id="site-navigation" class="designfly-main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'designfly' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_id' => 'primary-menu',
'menu_class' => 'primary-menu menu',
'depth' => 3,
)
);
?>
<form class="navigation__form" role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ), 'designfly' ); ?>">
<label class="screen-reader-text" for="search-box">Search Box</label>
<input class="navigation__form__box" type="text" value="" name="s" id="search-box" />
<?php
if ( wp_get_attachment_url( get_theme_mod( 'designfly-site-navigation' ) ) === false ) {
?>
<input id="searchsubmit" class="navigation__form__button" type="image" alt="Search" src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/src/img/search-icon.png" />
<?php
} else {
?>
<input id="searchsubmit" class="navigation__form__button" type="image" alt="Search" src="<?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-site-navigation' ) ) ); ?>" />
<?php
}
?>
</form>
</nav><!-- #site-navigation -->
<button id = "navigation--togller" class="navigation--togller">☰</button>
</header><!-- #masthead -->
<!-- Home Page Carasoul -->
<?php
if ( is_front_page() ) :
?>
<div class="header-img" >
<!-- Carousel Posts -->
<?php
$designfly_carousel_query = new WP_Query(
array(
'post_type' => 'carousel',
)
);
if ( $designfly_carousel_query->have_posts() ) :
?>
<div id="carousel__container" class="carousel__content">
<?php
if ( wp_get_attachment_url( get_theme_mod( 'designfly-carousel-slider-left' ) ) === false ) {
?>
<input id="carousel__button--left" class="carousel__button--left" type="image" alt="Prev" src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/src/img/slider-arrow-left.png" />
<?php
} else {
?>
<input id="carousel__button--left" class="carousel__button--left" type="image" alt="Prev" src="<?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-carousel-slider-left' ) ) ); ?>" />
<?php
}
if ( wp_get_attachment_url( get_theme_mod( 'designfly-carousel-slider-right' ) ) === false ) {
?>
<input id="carousel__button--right" class="carousel__button--right" type="image" alt="Next" src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/src/img/slider-arrow-right.png" />
<?php
} else {
?>
<input id="carousel__button--right" class="carousel__button--right" type="image" alt="Next" src="<?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-carousel-slider-right' ) ) ); ?>" />
<?php
}
while ( $designfly_carousel_query->have_posts() ) :
$designfly_carousel_query->the_post();
?>
<div class="carousel__slides">
<div class="carousel__slides__title">
<?php the_title(); ?>
</div>
<div class="carousel__slides__content">
<?php the_content(); ?>
</div>
</div>
<?php
endwhile;
?>
</div>
<?php
else :
?>
<p>
<?php esc_html_e( 'No portfolio items found. Please add some portfolio items in admin-dashboard', 'designfly' ); ?>
</p>
<?php
endif;
?>
</div>
<?php endif; ?>
<!-- #Services Header -->
<div class = "service-nav">
<div class="service-nav-container">
<div class = "service">
<div class="service__icon" >
<a href = '#'>
<?php
if ( wp_get_attachment_url( get_theme_mod( 'designfly-service-1-icon' ) ) === false ) {
echo wp_kses_post( '<img alt="Service Icon" src="' . get_template_directory_uri() . '/assets/src/img/service-icon-1.png" />' );
} else {
?>
<img src=" <?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-service-1-icon' ) ) ); ?> "/>
<?php
}
?>
</a>
</div>
<a href = '#' class="service__content">
<h3><?php echo wp_kses_post( get_theme_mod( 'designfly-service-1-heading' ) ); ?></h3>
<p><?php echo wp_kses_post( get_theme_mod( 'designfly-service-1-content' ) ); ?></p>
</a>
</div>
<div class = "service">
<div class="service__icon">
<a href = '#'>
<?php
if ( wp_get_attachment_url( get_theme_mod( 'designfly-service-2-icon' ) ) === false ) {
echo wp_kses_post( '<img alt="Service Icon" src="' . get_template_directory_uri() . '/assets/src/img/service-icon-2.png" />' );
} else {
?>
<img src=" <?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-service-2-icon' ) ) ); ?> "/>
<?php
}
?>
</a>
</div>
<a href = '#' class="service__content">
<h3><?php echo wp_kses_post( get_theme_mod( 'designfly-service-2-heading' ) ); ?></h3>
<p><?php echo wp_kses_post( get_theme_mod( 'designfly-service-2-content' ) ); ?></p>
</a>
</div>
<div class = "service">
<div class="service__icon">
<a href = '#'>
<?php
if ( wp_get_attachment_url( get_theme_mod( 'designfly-service-3-icon' ) ) === false ) {
echo wp_kses_post( '<img alt="Service Icon" src="' . get_template_directory_uri() . '/assets/src/img/service-icon-3.png" />' );
} else {
?>
<img src=" <?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'designfly-service-3-icon' ) ) ); ?> "/>
<?php
}
?>
</a>
</div>
<a href = '#' class="service__content">
<h3><?php echo wp_kses_post( get_theme_mod( 'designfly-service-3-heading' ) ); ?></h3>
<p><?php echo wp_kses_post( get_theme_mod( 'designfly-service-3-content' ) ); ?></p>
</a>
</div>
</div>
</div><!-- #Services Header -->
<div id="content" class="site-content ">