-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-geo_project.php
151 lines (151 loc) · 7.46 KB
/
single-geo_project.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
<?php
get_header();
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>
<div class="col-md-5" id="topNavLinks">
<span class="navLink">← <a href="<?php bloginfo('url'); ?>" title="go back to the home page of our site">home</a></span>
<span class="navLink">← <a href="<?php bloginfo('url'); ?>/projects" title="go to a page with all of our projects">projects</a></span>
</div>
</div><!-- contactNav -->
</div><!-- .row -->
<div class="row"><div class="col-md-12"><h1></h1></div></div>
<!-- <div class="grid_12"><h1> </h1></div> --> <!-- shameful hack for vertical line & whitespace -->
<div class="row">
<div class="col-md-6 pull-right" id="projectImage">
<?php
if ( has_post_thumbnail() ) {
$img_args = array(
'class' => 'img-responsive'
);
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
$meta = wp_prepare_attachment_for_js($attachment->ID);
$caption = $meta['caption'];
echo '<a rel="lightbox" title="' .$caption. '" href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
the_post_thumbnail('project-medium', $img_args);
echo '</a>';
}
?>
</div>
<div class="col-md-6">
<h2>
<?php
the_title();
?>
</h2>
<div class="row">
<div id="projectMeta" class="col-md-5 col-sm-4">
<table>
<?php
$for = get_post_meta($post->ID, 'for', true);
if (!empty($for)) {
echo '
<tr>
<td class="key">for</td>
<td class="partner">';
echo $for;
echo '</td>
</tr>';
}
$with = get_post_meta($post->ID, 'with', true);
if (!empty($with)) {
echo '
<tr>
<td class="key">with</td>
<td class="partner">';
echo $with;
echo '</td>
</tr>';
}
$and = get_post_meta($post->ID, 'and', true);
if (!empty($and)) {
echo '
<tr>
<td class="key">and</td>
<td class="partner">';
echo $and;
echo '</td>
</tr>';
}
?>
<tr>
<td class="key">
status
</td>
<td>
<?php
$terms = wp_get_object_terms( $post->ID, 'status');
foreach ( $terms as $term ) {
echo $term->name;
}
?>
</td>
</tr>
<tr>
<td class="key">
as of
</td>
<td>
<?php echo get_the_date('F Y'); ?>
</td>
</tr>
</table>
</div>
<div id="summary" class="col-md-7 col-sm-8">
<span class="key">summary</span>
<span id="summaryText">
<?php the_excerpt(); ?>
</span>
</div>
</div>
<div class="row">
<div id="description" class="col-md-12">
<?php
the_content();
edit_post_link();
?>
</div>
</div>
</div>
<div class="col-md-6 col-xs-12 pull-right">
<div class="row">
<?php
// working from http://codex.wordpress.org/Function_Reference/wp_get_attachment_image#Display_all_images_as_a_list
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts( $args );
array_pop($attachments); // drop the last attachment in the array, becauase it always seems to be the main image which we don't want to repeat
foreach ( $attachments as $attachment ) {
?>
<div class="col-xs-6 projectThumb">
<?php
$largeSrcArray = wp_get_attachment_image_src($attachment->ID, 'large');
$largeUrl = $largeSrcArray[0];
$thumbSrcArray = wp_get_attachment_image_src($attachment->ID, 'project-thumbnail');
$thumbUrl = $thumbSrcArray[0];
$meta = wp_prepare_attachment_for_js($attachment->ID);
$caption = $meta['caption'];
echo '<a rel="lightbox" title="' .$caption. '" href="'.$largeUrl.'"><img class="img-responsive" src="'.$thumbUrl.'"></a>'; // The rel="lightbox" attribute seems to be needed for most lightbox plugins.
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 navLinks">
<span class="navLink">← <a href="<?php bloginfo('url'); ?>" title="go back to the home page of our site">home</a></span>
<span class="navLink">← <a href="<?php bloginfo('url'); ?>/projects" title="go to a page with all of our projects">projects</a></span>
<span class="navLink"><a href="#top" title="jump back to the top of this page">top</a> ↑</span>
</div>
</div>
<?php endwhile; else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
<?php get_footer(); ?>