-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_child.php
43 lines (36 loc) · 988 Bytes
/
page_child.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
<?php
/**
* Template Name: Child Page
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Systemorph_2018
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) :
the_post();
if ( $post->post_parent ) { ?>
<a class="link-back" href="<?php echo get_permalink( $post->post_parent ); ?>">
Back to <?php echo get_the_title( $post->post_parent ); ?>
</a>
<?php }
get_template_part( 'template-parts/page/content', 'page-child' );
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .wrap -->
<?php
get_footer();