Hello,
To remove the download count, you will need to override our plugin template. You can learn more about it at https://www.download-monitor.com/kb/overriding-content-templates/.
The file you will need to override is named “content-download-filename.php” and you can find it inside the “wp-content/plugins/download-monitor/templates” folder. Copy that file and place it inside a new “download-monitor” subfolder within your active theme/child theme. After placing it here, you can then modify the code to remove the download count.
I hope that answers your query. Let us know if you have any further questions.
Hi Harish,
Thank you for your reply. I tried following the instructions but I cannot remove the download count.
Here is what I have done:
(1) Copied and renamed content-download-filename.php to content-download-filename-no-count.php. The renamed file is stored with the other download monitor templates.
(2) In WordPress I went to Downloads > Settings and set Default Template = Custom template and Custom Template = content-download-filename-no-count.
(3) I do not know PHP so I just guessed that I needed to remove the last line of code in the content-download-filename-no-count.php file:
<?php
/**
* Default output for a download via the [download] shortcode
*/
if ( ! defined( ‘ABSPATH’ ) ) {
exit;
} // Exit if accessed directly
/** @var DLM_Download $dlm_download */
?>
get_version()->get_filetype(); ?>”
title=”<?php if ( $dlm_download->get_version()->has_version_number() ) {
printf( __( ‘Version %s’, ‘download-monitor’ ), $dlm_download->get_version()->get_version_number() );
} ?>” href=”<?php $dlm_download->the_download_link(); ?>” rel=”nofollow”>
<?php echo $dlm_download->get_version()->get_filename(); ?>
Can you please tell me what I’m doing wrong and correct the code, if necessary.
Thank you.
Peter
I got it to work by copying content-download-button.php to content-download-simple-button.php and removing the codes for count and file size as follows:
<?php
/**
* Download button
*/
if ( ! defined( ‘ABSPATH’ ) ) {
exit;
} // Exit if accessed directly
/** @var DLM_Download $dlm_download */
?>
<p>the_download_link(); ?>” rel=”nofollow”>
<?php printf( __( ‘Download “%s”’, ‘download-monitor’ ), $dlm_download->get_title() ); ?>
</p>
The pages contain the following shortcode:
[download id=”1302″ template=”simple-button”]
Thank you. I’ll give it a try.