-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
102 lines (59 loc) · 2.2 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
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
<html <?php language_attributes(); ?>>
<header>
<meta charset="<?php bloginfo('charset'); ?>" >
<meta name="viewport" content="width=device_width , initial-scale=1" >
<?php get_header(); ?>
</header>
<?php
while(have_posts()){
the_post(); ?>
<div class="page-banner">
<div class="page-banner__bg-image" style="background-image: url('<?php echo get_theme_file_uri('/images/ocean.jpg'); ?>');"></div>
<div class="page-banner__content container container--narrow">
<h1 class="page-banner__title"><?php the_title(); ?></h1>
<div class="page-banner__intro">
<p>Learn how the school of your dreams got started.</p>
</div>
</div>
</div>
<div class="container container--narrow page-section">
<?php echo get_the_ID(); ?>
<?PHP echo wp_get_post_parent_id( get_the_ID()); ?>
<?php $parent_id = wp_get_post_parent_id(get_the_id()); ?>
<?php if($parent_id){
?>
<div class="metabox metabox--position-up metabox--with-home-link">
<p><a class="metabox__blog-home-link" href="<? 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
$is_parent_page = get_pages(
array(
'child of' => get_the_ID()
));
if($parent_id || $is_parent_page){ ?>
<div class="page-links">
<h2 class="page-links__title"><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h2>
<ul class="min-list">
<li><?php
if($parent_id){
$findchildrenof = $parent_id;
}else{
$findchildrenof = get_the_id();
}
wp_list_pages(array(
'title_li' => NULL,
'child_of' => $findchildrenof,
'sort_column' => 'menu_order'
)); ?> </li>
</ul>
</div>
<?php } ?>
<div class="generic-content">
<?php the_content(); ?>
</div>
</div>
<?php }
?>
<?php get_footer(); ?>
</html>