-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpage.php
More file actions
40 lines (35 loc) · 1019 Bytes
/
page.php
File metadata and controls
40 lines (35 loc) · 1019 Bytes
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
<?php if ( !defined('ABSPATH') ) die();
/**
* The template for displaying all pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage From_Scratch
* @since 1.0
* @version 1.0
*/
$in_sidebar = get_theme_mod('child_pages') == 'sidebar';
$parent = $post->post_parent;
if ( $parent ) {
$children = wp_list_pages("title_li=&child_of=".$parent."&echo=0");
} else {
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
}
if ( is_page() && $children && $in_sidebar ) {
$sidebar = true;
} else {
$sidebar = false;
}
get_header(); ?>
<?php get_template_part( 'template-parts/page', 'banner' ); ?>
<div class="page-wrap<?php if ($sidebar) { echo ' has-sidebar'; } ?>">
<?php
if ($sidebar) {
get_template_part( 'template-parts/sidebar', 'burger' );
get_sidebar();
}
get_template_part( 'template-parts/page', 'content' );
?>
</div>
<?php get_footer(); ?>