-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-person.php
executable file
·91 lines (62 loc) · 2.44 KB
/
single-person.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
<?php
/**
* Single Episode Template
*/
?>
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
$person = Nexus_Person::factory(get_the_ID());
$cp_person = new Coprime_Person($person);
?>
<?php do_action('before_world'); ?>
<section id="world">
<div id="content-container">
<div class="content-wrapper">
<?php do_action('before_content'); ?>
<article id="item-<?php the_ID(); ?>" role="article" <?php post_class(); ?>>
<div class="box">
<?php do_action('before_in_content'); ?>
<header class="content-header">
<div class="person-avatar"><?php echo $cp_person->get_avatar(150); ?></div>
<h1 class="person-name"><?php echo $cp_person->get_formatted_name(); ?></h1>
<?php echo $cp_person->get_links(); ?>
<?php do_action('in_content_header'); ?>
</header>
<section class="content-section">
<?php echo $cp_person->get_content(); ?>
<div class="related">
<?php
$query = Coprime::get_instance()->get_person_episodes($person->get_id());
// save the global wp_query; restore it after
// this will allow pagination to work
global $wp_query;
$_wp_query = $wp_query;
$wp_query = $query;
if ( $query->have_posts() ):
?>
<h3 class="episodes-with">Episodes with <?php echo $cp_person->get_name(); ?></h3>
<ul class="episode-list">
<?php while ($query->have_posts()): $query->the_post();
$episode = Nexus_Episode::factory(get_the_ID());
?>
<li><a href="<?php echo $episode->get_permalink(); ?>"><?php echo $episode->get_formatted_title(); ?></a></li>
<?php endwhile ?>
</ul>
<?php loop_pagination(array('mid_size' => 3, 'end_size' => 2)); ?>
<?php endif; $wp_query = $_wp_query; wp_reset_query(); wp_reset_postdata(); ?>
</div>
<?php do_action('in_content_section'); ?>
</section>
<footer class="content-footer">
</footer>
<?php do_action('after_in_content'); ?>
</div>
</article>
<?php do_action('after_content'); ?>
</div>
</div>
</section>
<?php do_action('after_world'); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>