How to show total Downloads in Easy Digital Downloads (EDD)

Follow the below instruction to show total Downloads in Easy Digital Downloads (EDD).

Go to functions.php and paste this code:

function edd_count_total_file_downloads() {
    global $edd_logs;
    return $edd_logs->get_log_count( null, 'file_download' );
}

Then to bring it all together, you can get the total number of customers, products, and file downloads with the following PHP:

<?php if ( class_exists( 'Easy_Digital_Downloads' ) ) { ?>
	<span class="edd-file-download-count"><?php echo edd_count_total_file_downloads(); ?> Downloads</span>
<?php} ?>

Thank you for reading this.