-
Notifications
You must be signed in to change notification settings - Fork 0
/
archived_code.php
505 lines (384 loc) · 16.5 KB
/
archived_code.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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
/* Adjust height, ikke i bruk
$(document).ready(function() {
var divHeight = $('.logo').height() * 0.85;
var divHeightCalc = divHeight;
$('.utgave').css('height', divHeight+'px');
});
$(document).ready(function() {
var divHeight = $('.logo').height() + ;
var divHeightCalc = divHeight;
$('.utgave').css('height', divHeight+'px');
});
Adjust height end */
/* NY NAVBAR
$('#toggle').click(function() {
$(this).toggleClass('active');
$('#overlay').toggleClass('open');
});
*/
/* NY NAVBAR END */
/* Make menu fit frontpage div height
$(function(){
var topbarHeight = document.getElementById('topbar').offsetHeight;
var logoHeight = document.getElementById('logo').offsetHeight;
var logoMenuHeight = document.getElementById('logoMenu').offsetHeight;
var sumHeight = topbarHeight + logoHeight + logoMenuHeight;
document.getElementById('fullscreenMenu').style.height = sumHeight+'px' ;
});
$(function() {
topbarHeight = document.getElementById('topbar').offsetHeight;
logoHeight = document.getElementById('logo').offsetHeight;
logoMenuHeight = document.getElementById('logoMenu').offsetHeight;
sumHeight = topbarHeight + logoHeight + logoMenuHeight;
});
function openNav() {
document.getElementById('fullscreenMenu').style.height = sumHeight+'px' ;
}
function closeNav() {
document.getElementById("fullscreenMenu").style.height = "0%";
}
2206
$(function() {
topbarHeight = $('#topbar').outerHeight();
logoHeight = $('#logo').outerHeight();
logoMenuHeight = $('#logoMenu').outerHeight();
coverHeight = $('#cover').outerHeight();
sumHeight = logoHeight;
});
*/
// max-height function for cover
/* legger den inline istedet
$(window).on('load', function() {
$topbarHeight = $('#topbar').outerHeight(true);
$logoHeight = $('#logo').outerHeight(true);
$logoMenuHeight = $('#logoMenu').outerHeight(true);
$coverHeight = $('#cover').outerHeight(true);
$maxCoverHeight = 200 + 'px';
//$searchHeight = $('#fullscreenSearch').outerHeight(true);
sumHeight = $topbarHeight + $logoHeight + $logoMenuHeight + $coverHeight;
});
*/
/* gjøre search like høy som cover
$(document).ready(function() {
$innholdHeight = $('#cover').height();
$('#fullscreenSearch').height($innholdHeight);
$('input').find('#s').focus();
});
*/
/*
$(window).on('load', function() {
searchHeight = calc(100vh - topbarHeight - logoHeight - logoMenuHeight);
});
*/
/* sumHeight = topbarHeight + logoHeight + logoMenuHeight + coverHeight + overlayHeight; */
/* Script for å endre farge osv på header i single
var distance = $('#textbox-article').offset().top,
$window = $(window);
$window.scroll(function() {
if ( $window.scrollTop() >= distance - 54 ) {
$('#header-single').css('background-color', '#f9f7f1');
$("#headerLogo").attr("src","/wp-content/uploads/2017/04/stoff.png");
$('#hamburger-single').css('color', 'black');
}
if ( $window.scrollTop() <= distance - 54 ) {
$('#header-single').css('background-color', 'black');
$("#headerLogo").attr("src","/wp-content/uploads/stoffhvit.png");
$('#hamburger-single').css('color', 'white');
}
});
// prøver å preloade svart logo, men kan ikek gjøre det sånn...
$(window).load(function() {
get('/wp-content/uploads/2017/04/stoff.png');
});
*/
<!-- x single-portrait start -->
<!-- RECOMMENDED ARTICLES
<div class="container">
<div class="row">
<div class="col-8">
<div class="single-textbox" style="padding-bottom: 250px;">
<?php // require(get_template_directory() . '/template-parts/mostread.php'); ?>
</div>
</div>
</div>
</div>
-->
<!-- Script for å endre bg og farge på logo når man kommer til leseboksen
<script type="text/javascript">
var distance = $('#textbox-article').offset().top,
$window = $(window);
$window.scroll(function() {
if ( $window.scrollTop() >= distance - 54 ) {
$('#header-single').css('background-color', '#f9f7f1');
$("#headerLogo").attr("src","/wp-content/uploads/2017/04/stoff.png");
$('#hamburger-single').css('color', 'black');
}
if ( $window.scrollTop() <= distance - 54 ) {
$('#header-single').css('background-color', 'black');
$("#headerLogo").attr("src","/wp-content/uploads/stoffhvit.png");
$('#hamburger-single').css('color', 'white');
}
});
// prøver å preloade svart logo, men kan ikek gjøre det sånn...
$(window).load(function() {
get('/wp-content/uploads/2017/04/stoff.png');
});
</script>
-->
<!-- x single-portrait end -->
<!-- x header.php start -->
<!--
var targetOffset = $("#siste-saker").offset().top;
var $w = $(window).scroll(function(){
if ( $w.scrollTop() < targetOffset ) {
$('#mest-lest').removeClass('initiallyHidden');
} else {
$('#logo-link').addClass('initiallyHidden');
}
});
*/
/*
$(window).scroll(function () {
if (scrollTimeout) {
// clear the timeout, if one is pending
clearTimeout(scrollTimeout);
scrollTimeout = null;
}
scrollTimeout = setTimeout(scrollHandler, 250);
});
var target = $(".myPara").offset().top;
var interval = setInterval(function() {
if ($(window).scrollTop() >= target) {
alert("made it!");
clearInterval(interval);
}
}, 250);
*/
-->
<!-- <body <?php // body_class(); ?>> -->
<!-- DESKTOP TOP BAR
<div class="container-fluid hidden-md-down" style="">
<div class="row " style="height: 50px; position: relative; display: flex; justify-content: space-around; align-items: center; ">
<div class="" style="">
<b>16. utgave</b>
</div>
<div class="" style="">
<i class="fa fa-facebook gray" style="font-size: calc(1em + 1vmin); padding: 0px 7px 0px 7px;" aria-hidden="true"></i>
<i class="fa fa-instagram gray" style="font-size: calc(1em + 1vmin); padding: 0px 7px 0px 7px;" " aria-hidden="true"></i>
<i class="fa fa-twitter gray " style="font-size: calc(1em + 1vmin); padding: 0px 7px 0px 7px;" aria-hidden="true"></i>
</div>
<div class="">
<a class="nav-link nav-link active graytext" style="font-size: calc(1em + 1vmin);" href="#"><i class="fa fa-search" aria-hidden="true"></i></a>
</div>
</div>
-->
<!-- Full screen menu
<div id="fullscreenMenu" class="fullscreen-menu hidden-md-down" style="">
<div style="display: flex; justify-content: flex-end; padding-right: 13px;">
<a href="javascript:void(0)" class="close-menu" onclick="closeNav()"><i class="fa fa-times" style="padding: 0 3px 0 15px;" aria-hidden="true"></i></a>
</div>
<div class="fullscreen-menu-content" style="">
<!-Innhold
<div id="desktop-menu" class="row justify-content-around offset-1 m-5" style="line-height: 2; font-weight: 200;">
<div class="col">
<span class="" style="font-size: 25px; font-weight: 400;">Kategorier</span>
<a class="" style="font-size: 25px;">Forsidestoff</a>
<a class="" style="font-size: 25px;">Ledere</a>
<a class="" style="font-size: 25px;">Tre kule folk</a>
<a id="samfunn-menu" class="reverse-underline" style="font-size: 25px; text-decoration: underline;">Samfunn</a>
<a class="" style="font-size: 25px; ">Løst gjenfortalt</a>
<a class="" style="font-size: 25px; ">Masterspalten</a>
<a class="" style="font-size: 25px; ">Under beltestedet</a>
</div>
<div class="col">
<a id="samfunn-menu" class="reverse-underline" style="font-size: 25px; text-decoration: underline;">Kultur</a>
<a class="" style="font-size: 25px; ">Bergen revels</a>
<a class="" style="font-size: 25px; ">Anmeldelser</a>
<a class="" style="font-size: 25px; ">Haien møter</a>
<a class="" style="font-size: 25px; ">Se og hør her og nå</a>
<a class="" style="font-size: 25px; ">Fotostoff</a>
<a class="" style="font-size: 25px; ">Månedens debutant</a>
<a class="" style="font-size: 25px; ">Posterboy</a>
</div>
<div class="col">
<a class="" style="font-size: 25px;">Debatt</a>
<a class="" style="font-size: 25px;">Quiz</a>
<a class="" style="font-size: 25px;">Tegneserier</a>
<a class="" style="font-size: 25px; text-decoration: underline;">Utgaver</a>
<a class="" style="font-size: 25px;">2015: 1 2 3 4 5 6</a>
<a class="" style="font-size: 25px;">2016: 7 8 9 10 11 12 13</a>
<a class="" style="font-size: 25px;">2017: 14 15 16 17 18</a>
<a class="" style="font-size: 25px; color: darkred;">Annonser</a>
</div>
</div>
</div>
</div>
-->
<!-- Papirutgave-boks *******************************************************************************
<div id="papirutgave-boks" class="initiallyHidden hidden-md-down papirutgave-shadow" style="border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black; height: 300px !important; width: 74vw; margin-left: 13vw; margin-right: 13vw; position: fixed; z-index: 1; background-color: black;">
<div id="papirutgave-innhold" style="display: flex; display: -webkit-flex; -webkit-overflow-scrolling: touch; overflow-x: scroll; margin-top: 25px;">
<!- Navigation arrows are sticky on top, put in place by flex's align-self
<div style="order: 0">
<i class="fa fa-chevron-left" style="font-size: 40px; font-weight: 100; margin-top: 80px;"></i>
</div>
<div style="order: 99">
<i class="fa fa-chevron-right" style="font-size: 40px; font-weight: 100; margin-top: 80px;"></i>
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow " style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
<div>
<img class="papirutgave-shadow" style="height: 200px;" src="/stof/wp-content/uploads/2017/04/stoff15.jpg">
</div>
</div>
</div>
-->
<!--
// Slide show/hide papirutgave on click + change icon WORKING BUT DISABLED
/*
$(document).ready(function(){
$("#papirutgave-klikk").find('a, i').click(function(event) {
event.stopPropagation();
$("#papirutgave-boks").slideToggle("fast");
$('#papirutgave-innhold').fadeIn('slow');
$('#papirutgave-ikon').toggleClass('fa-chevron-down fa-chevron-up');
});
$("#papirutgave-boks").on("click", function (event) {
event.stopPropagation();
});
});
// Fade out papirutgave-boks on click outside of box + change arrow from up to down
$(document).on("click", function () {
$("#papirutgave-boks").fadeOut('fast');
$('#papirutgave-ikon').toggleClass('fa-chevron-up fa-chevron-down');
});
// Fade out papirutgave-boks on scroll
$(window).scroll(function() {
if ($(this).scrollTop()>50)
{
$('#papirutgave-boks').fadeOut('slow');
}
});
END OF PAPIRUTGAVE-BOKS */ -->
<!-- Wordpress default search form
<form role="search" method="get" class="search-form" action="<?php // echo home_url( '/' ); ?>">
<label>
<span class="screen-reader-text"><?php // echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field"
placeholder="<?php // echo esc_attr_x( 'Søk', 'placeholder' ) ?>"
value="<?php // echo get_search_query() ?>" name="s"
title="<?php // echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
<input type="submit" class="search-submit" value="<?php // echo esc_attr_x( 'Search', 'submit button' ) ?>" />
</form>
-->
<!-- Search gammel working
<div id="fullscreenSearch" class="fullscreen-search hidden-md-down" style="">
<div class="fullscreen-menu-content" style="">
Innhold
<div id="desktop-search" class="" style="position: absolute; bottom: 0; height: 50vh !important;">
<div>
Search
</div>
</div>
</div>
</div>
-->
<!-- MENU DESKTOP START
<div class="container-fluid hidden-md-down">
<nav class="navbar navbar-toggleable-md " style="">
<div class="collapse navbar-collapse justify-content-center" style="padding-bottom: 1rem; " id="navbarNavAltMarkup">
<div class="navbar-nav " style="font-size: /*calc(0.7em + 1vmin)*/ 1rem; border-top: 1px solid #808080; margin-top: 20px;">
<a class="nav-item nav-link active meny gray" href="#">Samfunn</a>
<a class="nav-item nav-link active meny gray" href="#">Kultur</a>
<a class="nav-item nav-link active meny gray" href="#">Debatt</a>
<a class="nav-item nav-link active meny gray" href="#">Bergensguide</a>
<a class="nav-item nav-link active meny gray" href="#">Om oss</a>
</div>
</div>
</nav>
</div>
-->
<!-- <div class="navbar-nav" style="font-size: calc(1em + 1vmin);position:relative;left:0;top:0; vertical-align: 20px; white-space: nowrap;">
<i class="fa fa-facebook gray" style="" aria-hidden="true"></i>
<i class="fa fa-instagram gray" style="" " aria-hidden="true"></i>
<i class="fa fa-twitter gray " style="" aria-hidden="true"></i>
</div>-->
<!-- MENU DESKTOP END -->
<!--
<span id="morapuler" onclick="openSearch()" class="" style="font-size: calc(1em + 1vmin);" href="#">
<i class="fa fa-search"></i>
</span>
<script>
$('#vetdafaen').click(function(){
$(this).find('i').toggleClass('fa-search fa-times')
});
</script>-->
<!-- original
<i class="fa fa-search" style="padding: 0 3px 0 30px;" onclick="openSearch();this.setAttribute('onclick','closeSearch()')" aria-hidden="true"></i>
-->
<!-- x header.php end -->
<!-- x index.php start
original loop
$count = 0;
$firstpageQuery = new WP_query('category_name=Utgave 22&ignore_sticky_posts=true');
/* Start the Loop *
while ( $firstpageQuery -> have_posts() ) : $firstpageQuery -> the_post();
$count++;
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*
// Cover stories are set to sticky, thus the first post displayed. Cover story needs a different template, so we get this from content-aside.php. The post format is set in
if ( is_sticky() ) {
require( get_template_directory() . '/template-parts/content-aside.php' );
// if post format is standard, get_post_format actually returns null (!). Hence we want to require content-standard.php
} elseif ( empty( get_post_format() ) ) {
require( get_template_directory() . '/template-parts/content-standard.php' );
// else we can fetch template file for the format, ie. content-aside.php for cover (renamed in functions.php)
} else {
get_template_part('template-parts/content', get_post_format() );
}
if ($count == 1) {
require(get_template_directory() . '/template-parts/mostread.php');
echo '<div class="frontpage-margin hidden-md-down" style="margin-top: 10vh !important; display: flex; align-items: center;">
<div class="mest-lest" style=" font-size: 2.5rem; font-weight: 400; font-style: italic; padding-bottom: 15px;">
Siste saker
</div>
<span class="line"></span>
</div>';
}
endwhile;
// the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
*/
-->