Skip to content

Instantly share code, notes, and snippets.

@ericnicolaas
Created November 3, 2015 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericnicolaas/b24f48269eaebd5e841f to your computer and use it in GitHub Desktop.
Save ericnicolaas/b24f48269eaebd5e841f to your computer and use it in GitHub Desktop.
Reach child theme stats.php
<?php
/**
* Campaign stats.
*
* This is a variation of the default template provided in Reach. Instead of showing the percentage funded, it shows
* the actual funded amount. It also shows the goal amount.
*
* This should be saved to your-child-theme/charitable/campaign-loop/stats.php
*
* @package Reach
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$campaign = $view_args[ 'campaign' ];
$currency_helper = charitable()->get_currency_helper();
?>
<ul class="campaign-stats">
<li class="barometer" data-progress="<?php echo $campaign->get_percent_donated_raw() ?>"
data-width="42"
data-height="42"
data-strokewidth="8"
data-stroke="<?php echo get_theme_mod('secondary_border', '#dbd5d1') ?>"
data-progress-stroke="<?php echo get_theme_mod('accent_colour', '#7bb4e0') ?>">
</li>
<li class="campaign-raised">
<span><?php echo $currency_helper->get_monetary_amount( $campaign->get_donated_amount() ) ?></span>
<?php _e( 'Funded', 'reach' ) ?>
</li>
<li class="campaign-pledged">
<span><?php echo $campaign->get_monetary_goal() ?></span>
<?php _e( 'Goal', 'reach' ) ?>
</li>
<li class="campaign-time-left">
<?php echo $campaign->get_time_left() ?>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment