Follow these simple instructions to show the total downloads in Easy Digital Downloads (EDD):
Open your theme’s/child theme’s functions.php file and insert the following code:
function edd_count_total_file_downloads() {
global $edd_logs;
return $edd_logs->get_log_count( null, 'file_download' );
}
Once you’ve added the code to functions.php, consolidate the information by incorporating the following PHP snippet. This code allows you to retrieve the overall count of customers, products, and file downloads:
<?php if ( class_exists( 'Easy_Digital_Downloads' ) ) { ?>
<span class="edd-file-download-count"><?php echo edd_count_total_file_downloads(); ?> Downloads</span>
<?php } ?>
Ensure that you’ve included these snippets correctly in your theme’s functions.php file and the desired location in your template files. This will seamlessly display the total download count, providing valuable insights into the popularity of your digital products on your Easy Digital Downloads (EDD) powered website.
Leave a Reply