-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-pledge-options.php
More file actions
66 lines (55 loc) · 2.33 KB
/
single-pledge-options.php
File metadata and controls
66 lines (55 loc) · 2.33 KB
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
<?php
get_header();
?>
<section id="widget_campaignify_campaign_pledge_levels-2" class="campaign-widget widget_campaignify_campaign_pledge_levels arrowed">
<div class="container">
<h3 class="campaign-widget-title"><?php echo get_custom_option('pledge_options_title');?></h3>
<div class="campaignify-pledge-boxes campaignify-pledge-boxes-4 expired">
<?php global $post;
$meta = get_post_meta($post->ID,'pledge_options', true);
$data_price = $meta['amount'];
$limit = $meta['limit'];
$sold = '';
if (!$sold == '') {
$sold = $sold / $data_price;
}
$remaining = $limit - $sold;
$percent = ($sold/$limit) * 100;
/**
* if these values have hit their greatest amounts, they will be set to them.
*/
if($percent > 100) {
$percent = 100;
}
if($remaining < 0) {
$remaining = 0;
}
?>
<div class="campaignify-pledge-box <?php echo $modal_css_class; ?>" data-price="<?php echo $data_price; ?>-0">
<h3><?php the_title(); ?></h3>
<div class="donation-progress-bar">
<div class="donation-progress" style="width: <?php echo $percent; ?>%"></div>
</div>
<div class="backers">
<small class="limit">Limit of <?php
if($meta != '') {
echo $limit;
}else {
echo "Can't Display The Content";
}?>
—
<?php if($meta != '') {
echo $remaining;?> remaining
<?php
}else {
echo "Can't Display The Content";
}?>
</small>
</div>
<p><?php the_content(); ?></p>
</div>
<?php wp_reset_postdata(); ?>
</div>
</div>
</section>
<?php get_footer(); ?>