-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-hoy-en-3museos.php
71 lines (56 loc) · 1.63 KB
/
page-hoy-en-3museos.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
<?php
/*
* Template Name: Hoy en 3Museos
*/
get_header();
echo get_template_part('inc/slider');
echo get_template_part('inc/search-box');
$date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');
$niceDay = date_i18n('l, j', strtotime($date)).' de '.date_i18n('F Y.', strtotime($date));
$prev_date = date('d+M+Y', strtotime($date .' -1 day'));
$next_date = date('d+M+Y', strtotime($date .' +1 day'));
$prev_df = date('Ymd', strtotime($date .' -1 day'));
$next_df = date('Ymd', strtotime($date .' +1 day'));
$prev_url = '?';
if(isset($_GET["evType"])){
$prev_url .= 'evType='.$_GET["evType"];
}
if(isset($_GET["museum"])){
$prev_url .= '&museum='.$_GET["museum"];
}
if($_GET['date']){
$prev_url .= '&date='.$prev_date;
} else {
$prev_url .= 'date='.$prev_date;
}
if($_GET['dateFormat']){
$prev_url .= '&dateFormat='.$prev_df;
} else {
$prev_url .= '&dateFormat='.$prev_df;
}
$next_url = '?';
if(isset($_GET["evType"])){
$next_url .= 'evType='.$_GET["evType"];
}
if(isset($_GET["museum"])){
$next_url .= '&museum='.$_GET["museum"];
}
if($_GET['date']){
$next_url .= '&date='.$next_date;
} else {
$next_url .= 'date='.$next_date;
}
if($_GET['dateFormat']){
$next_url .= '&dateFormat='.$next_df;
} else {
$next_url .= '&dateFormat='.$next_df;
} ?>
<section id="events-post">
<div class="nav"><wrap>
<a href="<?php echo $prev_url ?>" class="button"><</a>
<h2><?php echo $niceDay; ?></h2>
<a href="<?php echo $next_url ?>" class="button r">></a>
</wrap></div>
<?php echo get_template_part('inc/loop2'); ?>
</section><?php
get_footer(); ?>