-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.php
69 lines (64 loc) · 2.04 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
<?php
/*
* Template Name: Page
* Description: Template for Default Page
*/
?>
<?php get_header(); ?>
<div class="content_container_page">
<?php
$theParent = wp_get_post_parent_id(get_the_ID()); //if parent page, this will = 0
$parent_active_class = '';
if ($theParent) {
$findChildrenOf = $theParent;
$parent_active_class = '';
// echo ' $theParent, findChildrenOf:' . $findChildrenOf;
// echo ', $theParent, theParent :' . $theParent;
// echo ', id: ' . get_the_ID();
} else {
$findChildrenOf = get_the_ID();
$parent_active_class = 'parent_active';
// echo 'findChildrenOf: ' . $findChildrenOf;
// echo ' , theParent:' . $theParent;
// echo ', id: ' . get_the_ID();
}
// echo $parent_active_class;
$pagesArray = get_pages(array(
'child_of' => get_the_ID()
));
//if is child page or parent page
if ($theParent or $pagesArray) {
?>
<aside class="page_aside section_spacing_top_aside">
<div class="container">
<ul>
<li class=" <?php echo $parent_active_class; ?> ">
<a href="<?php echo get_permalink($theParent) ?>">
<?php echo get_the_title($theParent) ?>
</a>
</li>
<?php wp_list_pages(array(
'title_li' => NULL,
'child_of' => $findChildrenOf
)); ?>
</ul>
</div>
</aside>
<?php
}
?>
<main class="page_main">
<?php //layouts of content_block_pages
if (function_exists('have_rows')) {
if (have_rows('content_block_pages')) {
while (have_rows('content_block_pages')) {
the_row();
$layout = get_row_layout();
//layout from templates folder
get_template_part('acf-templates/' . $layout);
}
}
} ?>
</main>
</div>
<?php get_footer(); ?>