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.
GINOM HANGSHING
March 21, 2017Where is the Function.php located.? When i goto plugin editor in EDD, there are so many function such as
easy-digital-downloads/includes/ajax-functions.php
easy-digital-downloads/includes/download-functions.php
and many more.
Can You Please Provide me more details on these…
Rubel Miah
March 22, 2017This is not plugin php file. You need go to theme directory “theme-directory > functions.php” and paste first code.
GINOM HANGSHING
March 22, 2017Thank You. I have pasted the code and where will the results be shown? I host an mp3 website but by pasting this cost, nothing happens? my mail: [email protected]
Rubel Miah
March 22, 2017Give me your website link.
GINOM HANGSHING
March 22, 2017can you provide me your mail? since my website is not yet publish to the public. we are in the progress of construction. I will send in your mail.
Rubel Miah
March 22, 2017Sure abs.rubel1[at]gmail.com
GINOM HANGSHING
March 22, 2017check your mail
Thanks
Rubel Miah
March 22, 2017OK
Logopik
April 29, 2017Hello Dear Rubel,
I am a newbie, I have a store built with EDD. Now I want to show the total downloads count in a part of my website. And it will be a live countdown like Freepik . com does on the footer. Is it possible with this code? And how to use this code? Is it a plugin or I need to put this code in my website? Please help me as I am very much newbie on this EDD.
Thanks in Advance 🙂
Zak
Rubel Miah
April 29, 2017Use this code in your functions.php
function edd_count_total_file_downloads() {
global $edd_logs;
return $edd_logs->get_log_count( null, ‘file_download’ );
}
And use this code for download count in footer
echo edd_count_total_file_downloads();
Thanks
Logopik
April 29, 2017Hello Bro I add the first code on Theme function.php (please check: http://imgur.com/s6c2pwd )
And then add the second code on Footer.php, as well as try on widget, but it is not working…(please check: http://imgur.com/j2QZs64 )
Can you please help me with this? Do you need my login so you can try your self, if you have some time of course! I can send you login through you contact page.
Thanks Bro
Rubel Miah
April 29, 2017Please copy the second code on my post section.
Logopik
April 29, 2017Hi I did exactly, I copy the code from your post (the second code) but it is not working, can you please check: http://imgur.com/oR1AKls
Thanks
Rubel Miah
April 29, 2017Give me site info at [email protected]
Toufic Nabi
September 13, 2017Thanks
Rubel Miah
September 14, 2017Welcome.
Toufic Nabi
October 24, 2017HI, I will be grateful if you could tell me how can I add a DEMO URL of my EDD product. I am using https://wordpress.org/plugins/edd-download-info/ but not sure how to implement in the page.
Many Thanks
Toufic