forked from kan-o-ash/the-cannon-newspaper-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabouttemplate.php
210 lines (182 loc) · 5.63 KB
/
abouttemplate.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
<?php
/*
Template Name: abouttemplate
*/
?>
<?php get_header(); ?>
<style type="text/css">
.authors {
overflow: auto;
}
.author-cell {
padding: 0;
width: 33%;
display: inline-block;
}
.author-link {
width: 100%;
margin: auto;
}
.author-inner{
width: 100%;
margin:auto;
}
.avatar-wrap {
width: 100%;
margin: 0;
}
.about-avatar {
width: 160px;
height:240px;
margin: 10px auto;
}
.about-avatar img{
width: 100%;
}
.about-info {
font-size: 1.2em;
width: 100%;
text-align: center;
color: black;
position: relative;
z-index: 2;
}
.about-info h6{
font-size:1.4em;
}
.about-info a{
width:245px;
margin:auto;
}
.authors a {
display:inline;
text-decoration:none;
font-size: 0.9em;
}
.author-table tr:nth-child(odd) td {
background-color: transparent;
}
tr:nth-child(even) {
background-color: #f4f4f4;
}
.author-cell:hover {
background: rgba(0,0,0,0.05);
}
.page-template-abouttemplate-php #content .post-content{
padding:0;
}
@media screen and (max-width: 980px) {
.author-cell {
width:50%;
}
.about-avatar img{
//width: 150px;
}
}
@media screen and (max-width: 640px) {
.author-cell {
width:50%;
}
.about-avatar img{
//width: 140px;
}
.authors a {
font-size: 12px;
}
}
</style>
<script type="text/javascript">
$ = jQuery
$(document).ready(function() {
$('#masonry').masonry({
columnWidth: 297,
itemSelector: '.author-cell'
}).imagesLoaded(function() {
$('#masonry').masonry('reload');
});
});
</script>
<!--BEGIN #content -->
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!-- #hentry-wrap -->
<div id="hentry-wrap">
<!--BEGIN .hentry -->
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<!--BEGIN .post-header-->
<div class="post-header">
<div class="inner">
<h2 class="post-title">About The Cannon</h2>
<!--END .post-header -->
</div>
<!--BEGIN .post-content -->
<div class="post-content">
<p style="text-align: left; font: normal 13px/1.8 'Merriweather', serif;">The Cannon is the official newspaper of the University of Toronto <a href="http://skulepedia.ca/wiki/Engineering_Society" title="Engineering Society" target="_blank">Engineering Society</a>.
Established in 1978, it serves the undergraduate students of the Faculty of Applied Science and Engineering, with a circulation of up to 4000 across the University of Toronto campus.
It is one of two newspapers funded by the Engineering Society, and is the more serious of the two.</p>
<h2 class="post-title" style="text-align:center;padding: 0; background:none;">Meet the team</h2>
<h2 class="post-title" style="text-align:center;">1T2 - 1T3</h2>
<?php /*
$authors = get_users('orderby=mata_value');
$args = array(
'orderby' => 'meta_value',
'order' => 'ascending',
'meta_key' => 'order',
'meta_query' => array(
), // End of meta_query
'exclude' => array(
1
),
);
$q = new WP_User_Query($args);*/
$order = $wpdb->get_results("SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key='order' ORDER BY meta_value ASC", "ARRAY_N");
$authors = array();
foreach($order as $aid)
$authors[] = new WP_User($aid[0]);
$count = 0;
?>
<div class="authors" id="masonry">
<?php foreach ($authors as $curauth) { ?>
<div class="author-cell isotope">
<div class="author-inner">
<a class="author-link" href="<?php echo get_author_posts_url($curauth->ID); ?>">
<div class="avatar-wrap">
<div class="about-avatar"> <?php //echo $curauth; ?>
<?php
$imgs_rel_dir = "/images/authors/";
$img_rel_path = $imgs_rel_dir.$curauth->first_name."-web.jpg";
$img_path = get_template_directory().$img_rel_path;
if (file_exists($img_path)) $img_url = get_bloginfo('template_directory').$img_rel_path;
else $img_url = get_bloginfo('template_directory').$imgs_rel_dir."placeholder.jpg";
?>
<img src="<?php echo $img_url; ?>"/>
</div>
</div>
</a>
<?php
$info = '<h2>'.$curauth->first_name.' '.$curauth->last_name."</h2><br />".$curauth->aim."<br />".$curauth->yim;
if ($count < 10){
if ($curauth->first_name == "Maddy"){
$curauth_email = "[email protected]";
}
else{ $curauth_email = $curauth->user_email; }
$info = $info . '<br /><a href="mailto:' .$curauth_email.'">'.$curauth_email."</a>";
}
?>
<div class="about-info"><?php echo $info ?></div>
</div>
</div>
<?php $count++;} ?>
</div>
<!--END .post-content -->
</div>
<!--END .hentry-->
</div>
</div>
<?php endwhile; else : ?>
<?php endif; ?>
</div>
<!-- /#hentry-wrap -->
</div>
<!-- #content -->
<?php get_footer(); ?>