Created
April 2, 2016 05:02
-
-
Save Creativenauts/dcf00751531fd0286eb8eccbaa8a3c68 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Change Price To Free When Price = $0.00
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
function get_download_price() { | |
$price = edd_get_download_price(get_the_ID()); | |
if ( $price == "0.00" ) { | |
echo 'Free'; | |
} else { | |
echo '$'.$price; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a custom function I created to display the price as "free" for downloads that price is $0.00.
You should place this in your themes function.php file.
Calling the function in your theme:
<?php get_download_price() ?>