Content Templates

When outputting download links, Download Monitor uses special templates to control the appearance of links. For example, content-download.php contains the following:

<a class="download-link" title="<?php if ( $dlm_download->get_version()->has_version_number() ) {
	printf( __( 'Version %s', 'download-monitor' ), $dlm_download->get_version()->get_the_version_number() );
} ?>" href="<?php $dlm_download->the_download_link(); ?>" rel="nofollow">
	<?php $dlm_download->the_title(); ?>
	(<?php printf( _n( '1 download', '%d downloads', $dlm_download->get_download_count(), 'download-monitor' ), $dlm_download->get_download_count() ) ?>)
</a>

This outputs a download link containing the title and download count. To use this specific template you would add template=”download” to your shortcode attributes. For example:

[download id="10" template="download"]

Download Monitor also includes the following templates for use by default:

content-download-box.php

Outputs your download link in a box:

The download display when using the box template
The download display when using the box template

To use this template add the following attribute to your shortcode declaration template="box". For example:

[download id="10" template="box"]

content-download-button.php

Outputs a download button:

The download display when using the button template
The download display when using the button template

To use this template add the following attribute to your shortcode declaration template=”button”. For example:

[download id="10" template="button"]

With the help of the Buttons extension, you can create new, custom button templates to use with your downloads. To learn more about how the Buttons extension works, read more in our knowledge base article.

content-download-filename.php

Outputs the filename and icon:

The download display when using the filename template
The download display when using the filename template

To use this template add the following attribute to your shortcode declaration template=”filename”. For example:

[download id="10" template="filename"]

You can override template files and add your own ones! Click here to learn how.

Was this article helpful?
Start Protecting your WordPress Downloads

Protect and track downloads on WordPress... What are you waiting for?