-
Notifications
You must be signed in to change notification settings - Fork 1
/
archive-fund.php
78 lines (60 loc) · 1.41 KB
/
archive-fund.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
<?php
/**
* The template for displaying Archive pages
*/
get_header();
?>
<section id="primary" class="content-area wrap group" role="main">
<div class="content-wide">
<h1 class="page-title">Crowdfunding Campaigns</h1>
<?php
global $wp_query;
$wp_query->query_vars["orderby"] = 'title';
$wp_query->query_vars["order"] = 'ASC';
$wp_query->get_posts();
if ( have_posts() ) :
?>
<div class="crowd-funding">
<?php
// Start the Loop.
while ( have_posts() ) : 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
else : ?>
<p>No results for that search term.</p>
<?php
endif;
?>
</div>
</div>
</section><!-- #primary -->
<?php
get_footer();
?>