Repository navigation
Expand file tree
/
Copy pathheader.php
More file actions
282 lines (249 loc) · 14.4 KB
/
Copy pathheader.php
File metadata and controls
282 lines (249 loc) · 14.4 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
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
<title><?php wp_title('-',true, 'right'); ?> <?php bloginfo('name'); ?></title>
<meta NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/favicon-16x16.png">
<link rel="manifest" href="<?php echo get_stylesheet_directory_uri() ?>/favicons/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<?php wp_head(); ?>
</head>
<body itemscope itemtype="http://schema.org/WebPage" id="opsibody" <?php body_class(); ?>>
<div class="mainwrapper clearfix">
<div id="content_wrap">
<?php if (trim(strip_tags(get_field('top_header_line', 'option'))) != '') { ?>
<div class="top_bar_msg text-center">
<div class="container">
<div class="row">
<div class="col-md-12"><?php echo get_field('top_header_line', 'option'); ?></div>
</div>
</div>
</div>
<?php } ?>
<div class="headertop navbar_wrap alwaysfixed notfixed ">
<div class="container">
<div class="row menurow">
<div class="col-md-12 mainmenu menucol" role="navigation">
<?php
$menuargs = array(
'theme_location' => 'primary',
'menu' => 'Primary Menu',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'nav navbar-nav',
'menu_id' => 'primary-menu',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<div class="primary_nav_class" id="primary_nav"><ul id="%1$s" class="%2$s">%3$s</ul></div>',
'depth' => 0,
'walker' => new My_Custom_Nav_Walker()
);
$mobilemenuargs = array(
'theme_location' => 'mobile',
'menu' => 'Mobile Extra Menu',
);
?>
<div class="top_wrap clearfix">
<div class="translate inlineb pull-right">
<?php echo do_shortcode('[google-translator]'); ?> <!-- <i class="fa fa-chevron-down" aria-hidden="true"></i> -->
</div>
<div class="search inlineb pull-right">
<?php get_search_form(); ?>
</div>
</div>
<div class="menuwrapper clearfix">
<nav class="navbar navbar-default">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo site_url(); ?>" title="<?php bloginfo('name'); ?>">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/observatory-of-public-sector-innovation-logo.png" alt="Observatory of Public Sector Innovation" width="368" height="36" class="logo_img" />
</a>
<?php wp_nav_menu($mobilemenuargs); ?>
<button type="button" class="navbar-toggle pull-right collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar top-bar"></span>
<span class="icon-bar middle-bar"></span>
<span class="icon-bar bottom-bar"></span>
</button>
</div>
<div class="mobile_search_form">
<?php get_search_form(); ?>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<?php wp_nav_menu($menuargs); ?>
</div><!-- /.navbar-collapse -->
</nav>
</div>
</div>
</div>
</div>
</div>
<?php if (!is_front_page()) { ?>
<div class="topgradient clearfix"></div>
<?php } ?>
<div class="main_cont_wrap clearfix">
<div class="container">
<div class="row">
<div class="col-md-12 hidden-xs">
<?php if (!is_front_page() && function_exists( 'bp_is_blog_page' ) && bp_is_blog_page() ) { ?>
<div class="nitrobreadcrumb">
<?php // custom_breadcrumbs(); ?>
<?php
if ( function_exists( 'bcn_display' ) ) {
bcn_display();
}
?>
</div>
<?php } ?>
</div>
<?php
global $post;
if ($post) {
$layout = get_post_meta($post->ID, 'layout', true);
} else {
$layout = '';
}
// always sidebar for buddypress
if (function_exists( 'bp_is_blog_page' ) && ! bp_is_blog_page() ) {
$layout = '';
}
// but not on registration
if ( is_page('register') || ( is_singular() && get_post_type( $post ) == 'case' ) || ( is_singular() && get_post_type( $post ) == 'covid_response' ) || ( is_singular() && get_post_type( $post ) == 'bi-project' ) || ( is_singular() && get_post_type( $post ) == 'bi-unit' ) ) {
$layout = 'fullpage';
}
if (is_singular( array('post') )) {
if ( is_active_sidebar( 'singleblog' ) && $layout != 'fullpage') { ?>
<div class="col-sm-3 col-sm-push-9"><div class="sidewrap"><?php dynamic_sidebar( 'singleblog' ); ?></div></div>
<?php }
} elseif ( is_active_sidebar( 'sidebar_case_study' ) && ( is_post_type_archive( 'case' ) || is_tax( [ 'case_type', 'innovation-tag', 'country', 'innovation-badge', 'innovation-tag-opengov', 'innovation-badge-opengov'] ) ) ) { ?>
<div class="col-sm-3 col-sm-push-9">
<div class="sidewrap sidewrap_csfilters">
<div class="cs_sidebar_wrap">
<?php
$term_id = get_queried_object()->term_id;
$term = get_term( $term_id, 'case_type' );
$count_cases = $term->count;
?>
<?php echo __( 'Total cases:', 'opsi' ); ?> <span class="cs_counter"><?php echo $count_cases; ?></span><br />
<?php echo __( 'Search results:', 'opsi' ); ?> <span class="cs_counter"><?php echo facetwp_display( 'counts' ); ?></span>
</div>
<?php
$form_page_setting =
is_tax( 'case_type' ) && 'open-government' == get_queried_object()->slug ||
is_tax( 'innovation-tag-opengov' ) ||
is_tax( 'innovation-badge-opengov' ) ?
'case_study_form_page_open_gov' :
'case_study_form_page';
$case_study_form_page = get_field( $form_page_setting, 'option' );
if ( ! empty( $case_study_form_page ) ) {
$case_study_form_page_url = get_permalink( $case_study_form_page );
if ( ! empty( $case_study_form_page_url ) ) {
?>
<a class="button btn btn-default btn-block big covid-add-response-button" href="<?php echo $case_study_form_page_url; ?>"><?php echo __( 'Add an Innovation', 'opsi' ); ?></a>
<?php
}
}
$case_styudy_export_url = 'case_study_form_page_open_gov' == $form_page_setting ?
"https://oecd-opsi.org/wp-load.php?security_token=5cfa1374f2c6050b&export_id=11&action=get_data" :
"https://oecd-opsi.org/wp-load.php?security_token=ca1210d317b4601f&export_id=10&action=get_data";
?>
<a class="button btn btn-default btn-block big case-study-export-button" href="<?php echo $case_styudy_export_url . '&time=' . time(); ?>"><?php echo __( 'Export Case Studies', 'opsi' ); ?></a>
<h2><?php echo __( 'Filter innovations:', 'opsi' ); ?></h2>
<?php dynamic_sidebar( 'sidebar_case_study' ); ?>
<button class="button btn btn-default btn-block big reset-filters-button" onclick="FWP.reset()"><?php echo __( 'Clear All Filters', 'opsi' ); ?></button>
</div>
<?php
$taxonomy = get_queried_object();
$tax_term_slug = $taxonomy->slug;
if ( 'open-government' == $tax_term_slug ) {
dynamic_sidebar( 'sidebar_case_study_opengov_brand' );
} else {
?></div><?php
}
} elseif ( is_post_type_archive( 'bi-project' ) || is_post_type_archive( 'bi-unit' ) ) { ?>
<?php
} elseif ( get_queried_object_id() == get_field( 'covid_response_form_thank_you_page_submit', 'options' ) ) {
?>
<div class="single_img_wrap col-md-12 covid-banner">
<img src="/wp-content/uploads/2020/04/OPSI-Covid19-Tracker-banner.jpg" class="attachment-blog size-blog wp-post-image" alt="OPSI COVID-19 Innovative Response Tracker">
</div>
<?php
}
elseif ( is_active_sidebar( 'sidebar_covid_response_archive' ) && ( is_post_type_archive( 'covid_response' ) || is_tax( [ 'response-tag', 'response-badge' ] ) ) ) { ?>
<div class="single_img_wrap col-md-12 covid-banner">
<img src="/wp-content/uploads/2020/04/OPSI-Covid19-Tracker-banner.jpg" class="attachment-blog size-blog wp-post-image" alt="OPSI COVID-19 Innovative Response Tracker">
</div>
<div class="col-sm-3 col-sm-push-9">
<div class="sidewrap sidewrap_csfilters">
<div class="cs_sidebar_wrap">
<?php echo __( 'Total responses:', 'opsi' ); ?> <span
class="cs_counter"><?php echo wp_count_uncached_posts( 'covid_response' )['publish']; ?></span><br/>
<?php echo __( 'Search results:', 'opsi' ); ?> <span
class="cs_counter"><?php echo facetwp_display( 'counts' ); ?></span>
</div>
<?php
$covid_form_page = get_field( 'covid_response_form_page', 'option' );
if ( ! empty( $covid_form_page ) ) {
$covid_form_page_url = get_permalink( $covid_form_page );
if ( ! empty( $covid_form_page_url ) ) {
?>
<a class="button btn btn-default btn-block big covid-add-response-button" href="<?php echo $covid_form_page_url; ?>"><?php echo __( 'Add a Response', 'opsi' ); ?></a>
<?php
}
}
$export_url = get_field( 'export_covid_responses_url', 'option' );
if ( ! empty( $export_url ) ) {
?>
<a class="button btn btn-default btn-block big covid-export-button" href="<?php echo $export_url . '&time=' . time(); ?>"><?php echo __( 'Export All Data', 'opsi' ); ?></a>
<?php
}
?>
<h2><?php echo __( 'Filter Responses:', 'opsi' ); ?></h2>
<?php dynamic_sidebar( 'sidebar_covid_response_archive' ); ?>
<button class="button btn btn-default btn-block big reset-filters-button"
onclick="FWP.reset()"><?php echo __( 'Clear All Filters', 'opsi' ); ?></button>
</div>
</div>
<?php
} elseif ( is_singular('pat_submission') ) {
?>
<div class="single_img_wrap col-md-12 covid-banner">
<img src="" class="attachment-blog size-blog wp-post-image" alt="">
</div>
<?php
} elseif ( is_active_sidebar( 'sidebar' ) && $layout != 'fullpage' && !(is_home() && !is_front_page()) && bp_is_blog_page()) { ?>
<div class="col-sm-3 col-sm-push-9"><div class="sidewrap"><?php dynamic_sidebar( 'sidebar' ); ?></div>
<?php
} elseif ( is_home() && !is_front_page()) {
if ( is_active_sidebar( 'blog' ) && $layout != 'fullpage') { ?>
<div class="col-sm-3 col-sm-push-9"><div class="sidewrap"><?php dynamic_sidebar( 'blog' ); ?></div></div>
<?php }
} elseif (!bp_is_blog_page()) {
if ( is_active_sidebar( 'buddypress' ) && $layout != 'fullpage') { ?>
<div class="col-sm-3 col-sm-push-9"><div class="sidewrap"><?php dynamic_sidebar( 'buddypress' ); ?></div></div>
<?php }
}
?>