-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabout.php
162 lines (146 loc) · 5.7 KB
/
about.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/**
* Template Name: About Page
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
get_header(); ?>
<div id="primary" class="content-area ">
<div id="content" class="site-content container" role="main">
<?php /* The loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<div class="row padded-row">
<article id="post-<?php the_ID(); ?>" <?php post_class('col-md-8'); ?>>
<header class="entry-header">
<?php if (has_post_thumbnail() && ! post_password_required()) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages(array( 'before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'opengovfoundation') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' )); ?>
<footer class="entry-meta">
<?php edit_post_link(__('Edit', 'opengovfoundation'), '<span class="edit-link">', '</span>'); ?>
</footer><!-- .entry-meta -->
</div><!-- .entry-content -->
</article><!-- #post -->
<div class="col-md-4">
<?php get_template_part('get-involved'); ?>
</div>
</div>
<?php endwhile; ?>
<div class="people">
<?php
$this_page_id=$wp_query->post->ID;
query_posts(array('showposts' => 20, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_parent' => $this_page_id, 'post_type' => 'page'));
if (have_posts()) {
while (have_posts()) {
the_post();
echo "<div class='row padded-row'>";
echo "<h1 class='col-md-12'>".get_the_title()."</h1>";
$args=array(
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => 50,
'post_type' => get_post_type($post->ID),
'post_parent' => $post->ID
);
$childpages = new WP_Query($args);
if ($childpages->post_count > 0) { /* display the children content */
while ($childpages->have_posts()) {
$childpages->the_post();
$hascontent = strlen(get_the_content()) > 0;
?>
<div class="col-md-4">
<div class="thumbnail person"
<?php if ($hascontent) {
?>
data-toggle="modal" data-target="#exampleModal" data-img='<?php the_post_thumbnail('thumbnail', array( 'class' => ' img-circle' )) ?>'
<?php
}
?>
>
<span class="thumbnail-container">
<?php if ($hascontent) {
the_post_thumbnail('thumbnail', array( 'class' => ' img-circle' ));
} else {
the_post_thumbnail(array(350, 350));
}
?>
</span>
<div class="caption">
<h2><?php echo get_the_title() ?></h2>
<?php if (get_post_meta($post->ID, "Title", true)) {
?>
<p class="title"><?php echo get_post_meta($post->ID, "Title", true);
?></p><?php
}
?>
<div class="bio"><?php the_content();
?></div>
<?php if ($hascontent) {
?>
<a>See details</a>
<?php
}
?>
<?php if (get_post_meta($post->ID, "Link", true)) {
?>
<a href="<?php echo get_post_meta($post->ID, "Link", true) ?>">View Site</a>
<?php
}
?>
</div>
</div>
</div>
<?php
}
}
echo "</div>";
}
}
?>
</div>
<!-- BOOTSTRAP MODAL -->
<div class="modal" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="row">
<div class="image col-md-4"></div>
<h1 class="name col-md-8"></h1>
</div>
<h2 class="title"></h2>
<p class="bio"></p>
</div>
</div>
</div>
<!-- END BOOTSTRAP MODAL -->
</div><!-- #content -->
</div><!-- #primary -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/bootstrap.min.js"></script>
<script>
$(function() {
$('#exampleModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var name = $(event.relatedTarget).parent().find("h2").text(); // Extract info from data-* attributes
var title = $(event.relatedTarget).parent().find(".title").text(); // Extract info from data-* attributes
var bio = $(event.relatedTarget).parent().find(".bio").html(); // Extract info from data-* attributes
var image = $(event.relatedTarget).data("img"); // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('.name').text(name);
modal.find('.title').text(title);
modal.find('.bio').html(bio);
modal.find('.image').html(image);
});
});
</script>
<?php get_sidebar(); ?>
<?php get_footer(); ?>