-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
158 lines (109 loc) · 4.07 KB
/
single.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
<?php get_header(); ?>
<div class="layout_3col_vertNav fullHeight">
<?php
get_template_part( 'template-parts/content', 'aside_nav' );
?>
<div id="colContent" class="colContent centerContent">
<main id="ccc_main_content" class="ccc_main_content">
<?php
$associativeArray = array();
$pod1 = pods( 'vignette', get_the_id() );
$related2 = $pod1->field( 'timeline_items' );
//print_r($related2);
foreach ( $related2 as $rel2 ) {
$id2 = $rel2[ 'ID' ];
$someField = get_post_meta( $id2, 'timeline_start_date', true );
$associativeArray += [get_the_title( $id2 ) => date_format(date_create($someField),"Y")];
}
asort($associativeArray);
$timeline = '<span id="ltTemp"><div class="timeline" id="timelineBlock"><div class="timeline_inner">';
foreach($associativeArray as $x=>$x_value) {
$timeline = $timeline.'<div class="timelineItem">';
$timeline = $timeline.'<strong>'.$x_value.'</strong><br>';
$timeline = $timeline.$x;
$timeline = $timeline.'</div>';
}
$timeline = $timeline.'</div></div></span>';
// page content
if (have_posts()) :
while (have_posts()) : the_post();
$postId = get_the_ID();
?>
<div class="ccc_topBlock">
<h1><?php the_title(); ?><em> <?php echo get_post_meta($post->ID, 'subtitle', true); ?></em></h1>
</div>
<?php
the_content();
echo $timeline;
?>
<?php
endwhile;
else :
?>
<h2>No Posts Found</h2>
<p>Sorry, there are no posts yet.</p>
<?php
endif;
?>
</main>
</div>
<aside id="colAside" class="colAside">
<section class="ccc_topBlock"> </section>
<h2>Related persons</h2>
<?php
$pod = pods( 'vignette', get_the_id() );
$related = $pod->field( 'vignettes_linked' );
foreach ( $related as $rel ) {
$id = $rel[ 'ID' ];
echo '<a href="'.esc_url( get_permalink( $id ) ).'">'.get_the_title( $id ).'</a><br>';
}
?>
<h2>Keywords</h2>
<ul class="cccNestedList">
<?php
$post_categories = wp_get_post_categories( $postId, array(
'fields' => 'all',
'parent' => 0
) );
if( $post_categories ){ // Always Check before loop!
foreach($post_categories as $catt){
echo '<li>'.$catt ->name.'<ul>';
$post_sub_categories = wp_get_post_categories( $postId, array(
'fields' => 'all',
'parent' => $catt ->term_id
) );
foreach($post_sub_categories as $subcatt){
echo '<li>'.$subcatt ->name.'</li>';
}
echo '</ul></li>';
}
}
?>
</ul>
</aside>
</div>
<button type="button" name="button" class="hamburgerButton" id='hamburger' onclick="hamburger()">
<img src="<?php echo get_bloginfo( 'template_url' ); ?>/images/icons/icon-hamburger.svg" alt="" class="hamburgerIcon" id='hamburgerImg'>
</button>
<section class="notesPop" id="notePop" aria-label="If you click on a note, the note appears here.">
<div class="notesPopInner" id="notesPopInner"></div>
</section>
<script src="<?php echo get_bloginfo( 'template_url' ); ?>/js/hamburger-menu.js" charset="utf-8"></script>
<script src="<?php echo get_bloginfo( 'template_url' ); ?>/js/header2Navigation.js" charset="utf-8"></script>
<script src="<?php echo get_bloginfo( 'template_url' ); ?>/js/notesPopup.js" charset="utf-8"></script>
<?php get_footer();
// $timeline = '<span id="ltTemp"><div class="timeline" id="timelineBlock"><div class="timeline_inner">';
// $pod1 = pods( 'vignette', get_the_id() );
// $related2 = $pod1->field( 'timeline_items' );
// //print_r($related2);
// foreach ( $related2 as $rel2 ) {
// $id2 = $rel2[ 'ID' ];
// $timeline = $timeline.'<div class="timelineItem">';
// $someField = get_post_meta( $id2, 'timeline_start_date', true );
//
// $timeline = $timeline.'<strong>'.date_format(date_create($someField),"Y").'</strong><br>';
// $timeline = $timeline.get_the_title( $id2 );
// $timeline = $timeline.'</div>';
// }
// $timeline = $timeline.'</div></div></span>';
?>