forked from molovo/bushwick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
248 lines (215 loc) · 7.74 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo page_title('Page can’t be found'); ?> - <?php echo site_name(); ?></title>
<meta name="description" content="<?php echo site_description(); ?>">
<link rel="stylesheet" href="<?php echo theme_url('/css/melody.css'); ?>">
<link rel="stylesheet" href="<?php echo theme_url('/css/style.css'); ?>">
<!--<link rel="stylesheet" href="<?php echo theme_url('/fonts/merriweather-fontfacekit/stylesheet.css'); ?>">-->
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo rss_url(); ?>">
<link rel="shortcut icon" href="http://pedrolopes.net/favicon.ico" />
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic,900' rel='stylesheet' type='text/css'>
<script>var base = '<?php echo theme_url(); ?>';</script>
<meta name="viewport" content="width=device-width">
<meta name="generator" content="Anchor CMS">
<meta property="og:title" content="<?php echo site_name(); ?>">
<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo current_url(); ?>">
<meta property="og:image" content="<?php echo theme_url('img/og_image.png'); ?>">
<meta property="og:site_name" content="<?php echo site_name(); ?>">
<meta property="og:description" content="<?php echo site_description(); ?>">
<?php if(customised()): ?>
<!-- Custom CSS -->
<style><?php echo article_css(); ?></style>
<!-- Custom Javascript -->
<script><?php echo article_js(); ?></script>
<?php endif; ?>
<style>
.sidebar {
background: url("<?php echo theme_url('img/sidebar-home.jpg'); ?>") center no-repeat;
background-size: cover;
color: white;
text-shadow: 0px 1px 5px rgba(0,0,0,0.3);
}
.sidebar a {
color: white;
}
.sidebar a.current {
color: #F7F2CB;
}
</style>
<?php if (($img = article_custom_field('sidebar_image')) || ($img = page_custom_field('sidebar_image'))): ?>
<style>
.sidebar {
background: url("<?php echo $img; ?>") center no-repeat;
background-size: cover;
color: white;
text-shadow: 0px 1px 5px rgba(0,0,0,0.3);
}
.sidebar a {
color: white;
}
.sidebar a.current {
color: #F7F2CB;
}
</style>
<?php elseif(is_article()): ?>
<style>
.sidebar {
background: rgba(51,71,61,0.05);
color: rgb(51,71,61);
text-shadow: 0px 0px 0px transparent;
}
.sidebar a, .sidebar h1, .sidebar h4 {
color: #774553;
}
.sidebar a.current {
color: #C38596;
}
</style>
<?php elseif (page_slug() == 'search'): ?>
<style>
.sidebar {
background: url("<?php echo theme_url('img/search-bg.jpg'); ?>") center no-repeat;
background-size: cover;
color: white;
text-shadow: 0px 1px 5px rgba(0,0,0,0.3);
}
.sidebar a:hover {
color: #F7F2CB;
}
</style>
<?php elseif (!page_title()): ?>
<style>
.sidebar {
background: url("<?php echo theme_url('img/404-bg.jpg'); ?>") center no-repeat;
background-size: cover;
color: white;
text-shadow: 0px 1px 5px rgba(0,0,0,0.3);
}
.sidebar a:hover {
color: #F7F2CB;
}
</style>
<?php else: ?>
<style>
.sidebar a:hover {
color: #F7F2CB;
}
</style>
<?php
/*$i = 1;
while(file_exists($_SERVER['DOCUMENT_ROOT'] . base_url() . 'content/sidebar-images/bg' . $i . '.jpg')) {
$i++;
}
?>
<style>
.sidebar {
background: url("<?php echo base_url(); ?>content/sidebar-images/bg<?php echo rand(1,($i-1)); ?>.jpg") center no-repeat;
background-size: cover;
color: white;
text-shadow: 0px 1px 5px rgba(0,0,0,0.3);
}
.sidebar a {
color: white;
}
.sidebar a.current {
color: #F7F2CB;
}
</style>
<?php */endif; ?>
<?php
$latestPostURL = base_url() . Registry::get('posts_page')->slug . '/' . latest_post()->data['slug'];
$latestPostLink = '<a
href="' . $latestPostURL . '"
class="latest-post ' . ($latestPostURL == $_SERVER['REQUEST_URI'] ? 'current' : '') . '"
title="' . latest_post()->data['title'] . '"
>Latest Post</a>';
?>
</head>
<body>
<div class="sidebar">
<nav class="grid 1of1 sidebar-nav">
<a href="<?php echo base_url(); ?>" class="home <?php echo (is_homepage() ? 'current' : '') ?>">HOME</a>
<?php if(has_menu_items()): ?>
<?php while(menu_items()): ?>
<a href="<?php echo menu_url(); ?>" class="<?php echo (menu_active() ? 'current' : '') ?>" title="<?php echo menu_title(); ?>"><?php echo menu_name(); ?>
</a>
<?php endwhile; ?>
<?php endif; ?>
<a href="https://facebook.com/pdrlps" target="_blank" class="facebook"></a>
<a href="https://twitter.com/pedrolopes" target="_blank" class="twitter"></a>
<a href="#menu" class="menu icon">☰</a>
</nav>
<div class="container">
<div class="grid 1of1 sidebar-content force-grid">
<?php if(article_title()): ?>
<h1><?php echo article_title(); ?></h1>
<p class="grid 3of4 stick-to-grid remove-padding">
<?php echo article_author('real_name'); ?><br />
<?php echo article_date(); ?>
</p>
<p class="grid 1of4 stick-to-grid remove-padding ralign article-links">
<a<?php echo (article_previous_url() ? ' href="' . article_previous_url() . '"' : ''); ?>>←</a>
<a<?php echo (article_next_url() ? ' href="' . article_next_url() . '"' : ''); ?>>→</a>
</p>
<?php else: ?>
<h1 class="home"><?php echo site_name(); ?></h1>
<p><?php echo site_description(); ?></p>
<?php endif; ?>
</div>
</div>
</div>
<div class="main">
<div class="slidey">
<div class="container">
<aside class="grid 1of2 search">
<h5>Search</h5>
<form id="search" action="<?php echo search_url(); ?>" method="post">
<label for="term">Search my blog:</label>
<input type="text" id="term" name="term" placeholder="<?php echo (search_term() ? search_term() : 'To search post titles, type and hit enter…'); ?>" />
<button type="submit" value="Go">Go</button>
</form>
</aside>
<aside class="grid 1of2 categories">
<h5>Categories</h5>
<ul>
<?php while(categories()): ?>
<li>
<a href="<?php echo category_url(); ?>" title="<?php echo category_title(); ?>"><?php echo category_title(); ?></a>
<small><?php echo category_count(); ?></small>
</li>
<?php endwhile; ?>
</ul>
</aside>
<div class="grid 1of1 ralign">
<a href="#menu" class="menu icon">☰</a>
</div>
</div>
</div>
<!--<div class="tray">
<div class="container">
<div class="grid 1of2 search"></div>
<div class="grid 1of2 categories"></div>
</div>
</div>-->
<header id="top">
<div class="container">
<nav class="grid 1of1 top-nav">
<?php if(has_menu_items()): ?>
<?php while(menu_items()): ?>
<a href="<?php echo menu_url(); ?>" class="<?php echo (menu_active() ? 'current' : '') ?>" title="<?php echo menu_title(); ?>"><?php echo menu_name(); ?></a>
<?php endwhile; ?>
<?php endif; ?>
<a href="https://facebook.com/pdrlps" target="_blank" class="facebook"></a>
<a href="http://www.flickr.com/photos/pdrlps/" target="_blank" class="flickr"></a>
<a href="https://github.com/pdrlps" target="_blank" class="github"></a>
<a href="https://plus.google.com/107047888336850451581" target="_blank" class="gplus"></a>
<a href="http://linkedin.com/in/pdrlps/" target="_blank" class="linkedin"></a>
<a href="https://twitter.com/pedrolopes" target="_blank" class="twitter"></a>
<a href="#menu" class="menu icon">☰</a>
</nav>
</div>
</header>
<div class="container">