forked from theymc/season_8_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-program.php
More file actions
54 lines (43 loc) · 1.05 KB
/
single-program.php
File metadata and controls
54 lines (43 loc) · 1.05 KB
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
<?php
get_header(); ?>
<div id="main">
<div id="main_content">
<?php
// Conditionally display post content (based on whether or not your query returned any posts
if(have_posts()):
// While posts were returned, iterate through them all
while(have_posts()):
the_post();
?>
<article>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</article>
<?php
// Find connected pages
$connected = new WP_Query( array(
'connected_type' => 'team_to_module',
'connected_items' => $post,
'nopaging' => true
) );
// Display connected pages
echo '<p>Related pages:</p><ul>';
while ( $connected->have_posts() ) : $connected->the_post();
?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php
endwhile;
wp_reset_postdata(); // set $post back to original post
?>
<?php
endwhile;
endif;
?>
</ul>
</div>
</div>
<?php get_footer(); ?>