-
Notifications
You must be signed in to change notification settings - Fork 1
/
page.php
63 lines (53 loc) · 1.26 KB
/
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
<?php
global $post;
$ancestors = array_reverse(get_post_ancestors($post->ID));
if ($ancestors) {
$oldestAncestor = $ancestors[0];
} else {
$oldestAncestor = $post->ID;
}
$pageNav = wp_list_pages(
array(
'title_li' => '',
'depth' => 2,
'child_of' => $oldestAncestor,
'echo' => 0
)
);
get_header();
if (have_posts()) : while (have_posts()) : the_post();?>
<?php if ($ancestors): ?>
<div class="genealogy kicker">
<?php foreach ($ancestors as $ancestor): ?>
<a href="<?php echo get_permalink($ancestor); ?>"><?php echo get_the_title($ancestor); ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<h1><?php the_title(); ?></h1>
<div class="entry">
<?php if(has_post_thumbnail()) : ?>
<figure class="featured-image">
<?php the_post_thumbnail('full'); ?>
<figcaption>
<?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?>
</figcaption>
</figure>
<?php endif; ?>
<?php the_content(); ?>
<?php comments_template(); ?>
</div>
<?php if($pageNav): ?>
<nav role="contextual" class="contextual">
<ul>
<?php wp_list_pages(
array(
'title_li'=>'',
'include'=> $oldestAncestor
) ); ?>
<?php echo $pageNav; ?>
</ul>
</nav>
<?php endif; ?>
<?php endwhile; endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>