-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
57 lines (48 loc) · 1.68 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
<?php
get_header();
while (have_posts()) {
the_post(); ?>
<?php page_banner(); ?>
<div class="container container--narrow page-section">
<?php
$parent_id = wp_get_post_parent_id(get_the_ID());
if ($parent_id != 0) {
?>
<div class="metabox metabox--position-up metabox--with-home-link">
<p>
<a class="metabox__blog-home-link" href="<?php echo get_permalink($parent_id) ?>"><i class="fa fa-home" aria-hidden="true"></i>Back to <?php echo get_the_title($parent_id); ?></a> <span class="metabox__main"><?php the_title(); ?></span>
</p>
</div>
<?php
}
?>
<?php
$test_array = get_pages(array(
'child_of' => get_the_ID()
));
if ($parent_id || $test_array) { ?>
<div class="page-links">
<h2 class="page-links__title"><a href="<?php echo get_permalink($parent_id); ?>"><?php echo get_the_title($parent_id); ?></a></h2>
<ul class="min-list">
<?php
if ($parent_id != 0) {
$find_children_of = $parent_id;
} else {
$find_children_of = get_the_ID();
}
wp_list_pages(array(
'title_li' => NULL,
'child_of' => $find_children_of,
'sort_column' => 'menu_order'
)) ?>
</ul>
</div>
<div class="generic-content">
<?php the_content(); ?>
</div>
</div>
<?php } ?>
<?php
}
get_footer();
?>