forked from vektor-inc/biz-vektor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-parent.php
103 lines (96 loc) · 2.75 KB
/
page-parent.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/*
* Template Name: Child index page
*/
get_header(); ?>
<!-- [ #container ] -->
<div id="container" class="innerBox">
<!-- [ #content ] -->
<div id="content">
<?php if ( have_posts()) : the_post(); ?>
<?php
$content = NULL;
$content = get_the_content();
if ($content) { ?>
<div id="post-<?php the_ID(); ?>" class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . 'Pages:', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php } ?>
<?php if ( is_user_logged_in() == TRUE ) { ?>
<div class="adminEdit">
<span class="linkBtn linkBtnS linkBtnAdmin"><?php edit_post_link(__('Edit', 'biz-vektor')); ?></span>
</div>
<?php } ?>
<?php endif; ?>
<?php
$parentId = get_the_ID();
$args = 'posts_per_page=-1&post_type=page&orderby=menu_order&order=asc&post_parent='.$parentId;
query_posts($args);
if (have_posts()) :
$count = 1;
while (have_posts()) :
the_post();
if ( ( $count % 2 ) > 0 ) {
$layout = 'odd';
} else {
$layout = 'even';
}
?>
<!-- .child_page_block -->
<div class="child_page_block layout_<?php echo $layout ?>">
<div class="child_page_blockInner">
<h4 class="entryTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<?php if ( has_post_thumbnail()) { ?>
<div class="thumbImage">
<div class="thumbImageInner">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
</div>
</div><!-- [ /.thumbImage ] -->
<?php } ?>
<div class="childText">
<p><a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a></p>
<div class="moreLink"><a href="<?php the_permalink(); ?>"><?php echo _x( 'Read more', 'Link to page', 'biz-vektor' ); ?></a></div>
</div>
<span class="linkBtn linkBtnS linkBtnAdmin"><?php edit_post_link(__('Edit', 'biz-vektor')); ?></span>
</div>
</div>
<!-- /.child_page_block -->
<?php
$count++;
endwhile;
endif;
wp_reset_query();
?>
<?php biz_vektor_snsBtns(); ?>
<?php biz_vektor_fbComments(); ?>
</div>
<!-- [ /#content ] -->
<!-- [ #sideTower ] -->
<div id="sideTower">
<?php
if($post->ancestors){
foreach($post->ancestors as $post_anc_id){
$post_id = $post_anc_id;
}
} else {
$post_id = $post->ID;
}
if ($post_id) {
$children = wp_list_pages("title_li=&child_of=".$post_id."&echo=0");
if ($children) { ?>
<div class="localSection sideWidget">
<h3 class="localHead"><a href="<?php echo get_permalink($post_id); ?>"><?php echo get_the_title($post_id); ?></a></h3>
<ul class="localNavi">
<?php echo $children; ?>
</ul>
</div>
<?php } else { ?>
<?php } ?>
<?php } ?>
<?php get_sidebar(); ?>
</div>
<!-- [ /#sideTower ] -->
</div>
<!-- [ /#container ] -->
<?php get_footer(); ?>