/
miracle-children.php
executable file
·61 lines (50 loc) · 1.67 KB
/
miracle-children.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
<?php /* Template Name: Miracle Children */
get_header(); ?>
<div class="content-area">
<div class="main">
<aside>
<?php
$sidebarLoop = new WP_Query(array('post_type' => 'sidebar-items', 'posts_per_page' => -1, 'orderby' =>'meta_value', 'order' => 'ASC', 'meta_key' => 'sidebar-form-order'));
while ($sidebarLoop->have_posts()) {
$sidebarLoop->the_post();
$content = get_the_content();
$url = get_post_meta($post->ID, 'sidebar-form-url', true);
?>
<article class="sidebar-item">
<?php echo $content; ?>
</article>
<?php
}
?>
</aside>
<?php
while (have_posts()) {
the_post();
get_template_part( 'content', 'page' );
} ?>
<section class="children">
<?php
$childrenLoop = new WP_QUERY(array('post_type' => 'children', 'posts_per_page' => -1, 'orderby' => 'name', 'order' => 'ASC'));
while ($childrenLoop->have_posts()) {
$childrenLoop->the_post();
$title = get_the_title();
$content = get_the_content();
$image = get_the_post_thumbnail($post->ID, 'medium');
?>
<article class="child">
<h3><?php echo $title; ?></h3>
<div class="thumbnail"><?php echo $image; ?></div>
<a class = "fancybox button" href="#child-bio-<?php echo $post->post_name;?>" id="child-expand">Miracle Story</a>
<div class="fancybox" id="child-bio-<?php echo $post->post_name;?>">
<h3><?php echo $title;?></h3>
<?php echo $image; ?>
<p><?php echo $content; ?></p>
</div>
</article>
<?php }
?>
</section>
<div class="aside-placeholder"></div>
</div>
</div>
<?php get_footer(); ?>