-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-leyka_donation.php
55 lines (47 loc) · 1.41 KB
/
archive-leyka_donation.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
<?php
/**
* Donation history
**/
$campaign_slug = get_query_var('leyka_campaign_filter');
$campaign = null;
if($campaign_slug) {
if($campaign = get_posts(array('post_type' => 'leyka_campaign', 'post_name' => $campaign_slug)))
$campaign = reset($campaign);
}
get_header();
?>
<header class="heading">
<div class="container-text">
<?php knd_section_title(); ?>
<?php if($campaign){ ?>
<h4><?php esc_html_e('Campaign', 'knd');?>: <a href="<?php echo get_permalink($campaign);?>"><?php echo get_the_title($campaign);?></a></h4>
<?php } ?>
</div>
</header>
<div class="container-text main-content">
<section class="donations-history-results donation_history">
<?php
if(have_posts() && class_exists('Leyka_Donation')){
foreach($wp_query->posts as $p){
$donation = new Leyka_Donation($p);
$amount = number_format($donation->sum, 0, '.', ' ');
echo "<div class='ldl-item'>";
echo "<div class='amount'>{$amount} {$donation->currency_label}</div>";
$meta = array();
$name = $donation->donor_name;
$name = (!empty($name)) ? $name : __('Anonymous', 'knd');
$meta[] = '<span>'.$name.'</span>';
$meta[] = '<time>'.$donation->date_funded.'</time>';
echo "<div class='meta'>".implode(' / ', $meta)."</div>";
echo "</div>";
}
}
else {
echo "<p>";
echo "</p>";
}
?>
</section>
<section class="paging"><?php knd_paging_nav($wp_query); ?></section>
</div>
<?php get_footer();