Last active
October 26, 2015 01:28
-
-
Save ericnicolaas/73e7d99f1e67c1347147 to your computer and use it in GitHub Desktop.
Charitable campaign link in loop template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is designed to be a drop-in replacement for the donation button in the campaign loop. | |
* | |
* Instead of linking to the donation page, it links to the campaign page. The text is changed to Read More. | |
* | |
* Save this file at yourtheme/charitable/campaign-loop/donation-link.php | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
/** | |
* @var Charitable_Campaign | |
*/ | |
$campaign = $view_args[ 'campaign' ]; | |
if ( $campaign->has_ended() ) : | |
return; | |
endif; | |
?> | |
<div class="campaign-donation"> | |
<a class="donate-button button" href="<?php echo get_permalink( $campaign->ID ) ?>"><?php _e( 'Read More', 'your-namespace' ) ?></a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment