-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_childpages.php
71 lines (66 loc) · 2.01 KB
/
page_childpages.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
<?php
/**
* @package WordPress
* @subpackage DE-Minimal
* Template Name: Child Pages Template
*/
get_header(); ?>
<div id="post-<?php the_ID(); ?>" class="post">
<div class="wrapper">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="background">
<div id="logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo( 'name' ); ?>">
<img src="<?php echo bloginfo('stylesheet_directory')?>/images/dennis-circle.svg" />
</a>
</div>
<div class="headerimage">
<?php the_post_thumbnail(); ?>
<div id="hgroup">
<h1><?php the_title(); ?></h1>
<?php if (function_exists('the_subheading')) { the_subheading('<h2>', '</h2>'); } ?>
</div>
</div>
</div>
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
<?php //comments_template(); ?>
</div>
<?php endwhile; endif; ?>
</div>
</div>
<?php
$mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc', 'parent' => $post->ID ) );
// var $is_excerpt: boolean;
foreach( $mypages as $page ) {
$content = $page->post_excerpt;
if ( $content ) { // Check for empty page
$is_excerpt = true;
$content = apply_filters( 'the_content', $content );
} else {
$is_excerpt = false;
$content = $page->post_content;
$content = apply_filters( 'the_content', $content );
}
?>
<div id="post-<?php echo $page->ID; ?>" class="post">
<div class="background">
<div class="entry">
<h2>
<?php if($is_excerpt == true): ?>
<a href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a>
<?php else: ?>
<?php echo $page->post_title; ?>
<?php endif; ?>
</h2>
<?php echo $content;?>
<?php if($is_excerpt == true): ?>
<a href="<?php echo get_page_link( $page->ID ); ?>">Weiterlesen …</a>
<?php endif; ?>
</div>
</div>
</div>
<?php
}
?>
<?php get_footer(); ?>