-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-player-page.php
120 lines (103 loc) · 4.17 KB
/
archive-player-page.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
<?php get_header(); ?>
<!--email_off-->
<div id="wrapper">
<div id="pagecol" class='ajaxcol'>
<div class='page'>
<?php if ( isset ( $GLOBALS['bisons_flash_message'] ) ) : ?>
<p id="flashmessage"><i class="fa fa-bell-o"></class="fa
fa-bell-o"i><?php echo $GLOBALS['bisons_flash_message'] ?></p>
<?php endif ?>
<header>
<h2>Player's Area</h2>
<?php get_template_part( 'snippets/playerPage', 'menu' ) ?>
</header>
<?php get_template_part( 'snippets/playerPage', 'flashMessages' ) ?>
<?php
$committee_profiles = new WP_Query ( array(
'post_type' => 'committee-profile',
'nopaged' => 'true'
) );
if ( $committee_profiles->have_posts() ) : ?>
<h3>The committee</h3>
<p>If you have any questions, try asking an established member first. If they are unable to answer
your question, please get in contact with a member of our committee - their contact details are
below. If you are considering running for a committee position, have a more detailed read of the
different <a href='<?php echo $GLOBALS['blog_info']['url'] ?>/committee-profile/'>committee
positions</a>. If you are not sure about something, please ask us!</p>
<?php while ( $committee_profiles->have_posts() ) : $committee_profiles->the_post();
$incumbent = get_post_meta( get_the_id(), 'incumbent', true );
$photourl = wp_get_attachment_image_src( get_post_meta( $incumbent, 'image_id', true ),
'medium' );
if ( $photourl ) :
$name = get_post_meta( $incumbent, 'name', true );
$askme = get_post_meta( get_the_id(), 'askme', true );
$askme = strtolower( substr( $askme, 0, 1 ) ) . substr( $askme, 1 );
$phonenum = get_post_meta( get_the_id(), 'posphone', true );
?>
<div class='committeeList'>
<a class="desktopthumb" href='<?php the_permalink() ?>'><img
src='<?php echo $photourl[0]; ?>'/></a>
<div class='albumMeta'>
<ul>
<li><h3><?php echo get_post_meta( get_the_id(), 'posname', true ) ?>
(<?php echo get_post_meta( get_post_meta( get_the_id(), 'incumbent',
true ), 'name', true ); ?>)</h3>
</li>
<?php if ( get_post_meta( get_the_id(), 'posemail', true ) ) { ?>
<li class='fa fa-envelope-o'><a
href='mailto:<?php echo get_post_meta( get_the_id(), 'posemail',
true ) ?>'><?php echo get_post_meta( get_the_id(), 'posemail',
true ) ?></a></li><?php } ?>
<?php if ( get_post_meta( get_the_id(), 'posphone', true ) ) { ?>
<li class='fa fa-phone'><a
href='tel:<?php echo $phonenum ?>'><?php echo $phonenum ?></a>
</li><?php } ?>
<li><?php if ( $askme ) { ?><strong>Ask me
about</strong> <?php echo $askme ?><?php } ?></li>
</ul>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<div class='clear'>
<?php
$page_groups = get_categories( array(
'taxonomy' => 'player-page-groups'
)
);
foreach ( $page_groups as $group ) { ?>
<h3><?php echo $group->name; ?></h3>
<p><?php echo $group->description ?></p>
<table class="verticalTable">
<tbody>
<?php $page_list = new WP_Query( array(
'post_type' => 'player-page',
'paged' => - 1,
'player-page-groups' => $group->slug
) );
while ( $page_list->have_posts() ) :
$page_list->the_post();
$post = get_post();
$link = get_post_meta( get_the_id(), 'link', true );
?>
<tr>
<th class="left-col"><span
class='<?php echo $link ? 'fa fa-external-link-square' : 'fa fa-file' ?>'><a
href='<?php echo $link ? $link : get_permalink(); ?>'
title='<?php echo get_the_title(); ?>'><?php echo get_the_title(); ?></a></span>
</th>
<td><?php echo get_post_meta( get_the_id(), 'description', true ) ?>
</td>
</tr>
<?php endwhile;
?>
</tbody>
</table>
<?php } ?>
</div>
</div>
</div>
</div>
<!--/email_off-->
<?php get_footer(); ?>