PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.6.22
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.6.22
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / templates / widgets / campaigns.php

campaigns.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.6.22, at templates/widgets/campaigns.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display a list of campaigns.
4 *
5 * Override this template by copying it to yourtheme/charitable/widgets/campaigns.php
6 *
7 * @package Charitable/Templates/Widgets
8 * @author Studio 164a
9 * @since 1.0.0
10 * @version 1.4.18
11 */
12
13 $campaigns = $view_args['campaigns'];
14 $show_thumbnail = isset( $view_args['show_thumbnail'] ) ? $view_args['show_thumbnail'] : true;
15 $thumbnail_size = apply_filters( 'charitable_campaign_widget_thumbnail_size', 'medium' );
16
17 if ( ! $campaigns->have_posts() ) :
18 return;
19 endif;
20
21 echo $view_args['before_widget'];
22
23 if ( ! empty( $view_args['title'] ) ) :
24
25 echo $view_args['before_title'] . $view_args['title'] . $view_args['after_title'];
26
27 endif;
28 ?>
29 <ol class="campaigns">
30 <?php
31 while ( $campaigns->have_posts() ) :
32
33 $campaigns->the_post();
34
35 $campaign = new Charitable_Campaign( get_the_ID() );
36 ?>
37 <li class="campaign">
38 <?php
39 if ( $show_thumbnail && has_post_thumbnail() ) :
40
41 the_post_thumbnail( $thumbnail_size );
42
43 endif;
44 ?>
45 <h6 class="campaign-title"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h6>
46 <?php if ( ! $campaign->is_endless() ) : ?>
47 <div class="campaign-time-left"><?php echo $campaign->get_time_left() ?></div>
48 <?php endif ?>
49 </li>
50 <?php
51 endwhile;
52 ?>
53 </ol>
54 <?php
55
56 echo $view_args['after_widget'];
57
58 wp_reset_postdata();
59