-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-fundlist.php
88 lines (68 loc) · 1.56 KB
/
page-fundlist.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
<?php
/*
Template Name: Fund List
*/
get_header();
?>
<?php the_showcase(); ?>
<div class="wrap group academics three-column">
<div class="content-wide">
<?php
while ( have_posts() ) : the_post(); ?>
<h1><?php the_title() ?></h1>
<div class="entry-content">
<?php the_content(); ?>
</div>
<?php
endwhile;
$fund_categories = get_cmb_value( 'fund_category' );
$fund_query = new WP_Query(array(
'post_type' => 'fund',
'tax_query' => array(
array(
'taxonomy' => 'fund_cat',
'field' => 'id',
'terms' => $fund_categories,
),
),
));
if ( $fund_query->have_posts() ) :
?>
<div class="crowd-funding">
<?php
// Start the Loop.
while ( $fund_query->have_posts() ) : $fund_query->the_post();
?>
<div class="fund">
<a href="<?php the_permalink() ?>">
<div class="photo">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
print '<img src="https://placehold.it/500x500">';
}
$fund_info = get_fund_info();
if ( $fund_info['total'] > 0 ) {
print '<h4 class="fund-total">' . $fund_info['percent'] . '% Funded <span>(' . $fund_info['count'] . ' Donors)</span></h4>';
}
?>
</div>
<div class="info">
<h4><?php the_title(); ?></h4>
<?php the_excerpt(); ?>
</div>
</a>
</div>
<?php
endwhile;
?>
<div class="pagination">
<?php echo paginate_links(); ?>
</div>
<?php
endif;
?>
</div>
</div>
<?php get_footer(); ?>