-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthors.php
executable file
·51 lines (48 loc) · 1.57 KB
/
authors.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
<?php
/*
Template Name: Authors List
*/
?>
<?php get_header(); ?>
<div class="container">
<div class="panel archive">
<div class="panel_title">
<h2>Midd<b>START</b> People</h2>
</div>
<?php
$posts = get_posts(array('numberposts' => -1));
if (isset($wp_query->query_vars['middstart_authors_post'])) {
$posts = array(get_post($wp_query->query_vars['middstart_authors_post']));
}
$authors = array();
for ($i = 0; $i < count($posts); $i++) {
foreach(split(',', get_meta('middstart-credits', $posts[$i]->ID)) as $author) {
if ($author == '') continue;
$parts = split(' ', $author);
$lastname = $parts[count($parts) - 1];
$authors[$lastname.$author]['name'] = $author;
$authors[$lastname.$author]['posts'][] = $posts[$i];
}
}
ksort($authors);
?>
<table class="cubes authors">
<tr>
<?php
$i = 0;
foreach($authors as $author => $p) {
if ($i % 4 == 0 && $i != 0) print '<tr>';
print '<td class="cube c' . ($i % 16 + 1) . '"><div class="wrapper">' . $p['name'] .'<ul class="projects">';
foreach($p['posts'] as $post) {
print '<li><a href="' . $post->guid . '" title="Discuss ' . $post->post_title . '">' . $post->post_title . "</a></li>";
}
print '</ul></div></td>';
if ($i % 4 == 3 && $i != count($authors) - 1) print '</tr>';
$i++;
}
?>
</tr>
</table>
</div>
</div>
<?php get_footer(); ?>