-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
56 lines (48 loc) · 1.36 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
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
get_header();
?>
<?php
$has_subpages = false;
// Check to see if the current page has any subpages
$children = wp_list_pages('&orderby=menu_order&child_of='.$post->ID.'&echo=0');
if($children) {
$has_subpages = true;
}
// Reseting $children
$children = "";
if(is_page() && $post->post_parent) {
$children .= wp_list_pages("title_li=&orderby=menu_order&child_of=".$post->post_parent ."&echo=0&depth=1");
} else if($has_subpages) {
$children .= wp_list_pages("title_li=&orderby=menu_order&child_of=".$post->ID ."&echo=0&depth=1");
}
?>
<?php ?>
<?php if ($children) { ?>
<div class="row remove-bottom">
<div class="sixteen columns">
<ul class="sub-menu">
<?php echo $children; ?>
</ul>
</div>
</div>
<?php } ?>
<div class="row">
<div class="sixteen columns">
<div class="section remove">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php the_content(''); ?>
<?php wp_link_pages(); ?>
<!-- <?php trackback_rdf(); ?> -->
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php if (!of_get_option('comment_area') ) { ?>
<div class="row">
<div class="sixteen columns">
<?php comments_template(); ?>
</div>
</div>
<?php } ?>
<?php get_footer(); ?>