-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar-filmmaking.php
79 lines (65 loc) · 1.7 KB
/
sidebar-filmmaking.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
<?php if(is_page('how-to-filmmaking')) { ?>
<div class="sideitem grey">
<div class="taxonomy-item">
<h2>
<?php
if(get_field('alternate_title')) {
the_field('alternate_title');
} else {
the_title();
}
?>
</h2>
<?php
$filmmakingPages = array(
'depth' => 1,
'title_li' => '',
'post_type' => 'filmmaking',
'post_status' => 'publish'
);
wp_list_pages($filmmakingPages);
?>
</div><!-- taxonomy item -->
</div><!-- sideitem -->
<?php } else { ?>
<div class="sideitem grey">
<div class="taxonomy-item">
<?php if(count(get_post_ancestors($post->ID)) == 1 ) { ?>
<h2><?php echo get_page(array_pop(get_post_ancestors($post->ID)))->post_title; ?></h2>
<?php
$filmmakingPages = array(
'depth' => 1,
'child_of' => $post->post_parent,
'exclude' => '',
'include' => '',
'title_li' => '',
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'walker' => '',
'post_type' => 'filmmaking',
'post_status' => 'publish'
);
wp_list_pages($filmmakingPages);
?>
<?php } else { // if post count == 1 ?>
<h2><?php echo get_page(array_pop(get_post_ancestors($post->ID)))->post_title; ?></h2>
<?php
$filmmakingPages = array(
'depth' => 1,
'child_of' => $post->ID,
'exclude' => '',
'include' => '',
'title_li' => '',
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'walker' => '',
'post_type' => 'filmmaking',
'post_status' => 'publish'
);
wp_list_pages($filmmakingPages); ?>
<?php } // End Filmmaking ?>
</div><!-- taxonomy item -->
</div><!-- sideitem -->
<?php } /// else ?>