Installing the plugin
Activate like any other plugin and done. For usage instructions, continue reading to the “How to use” section below.
More info on installing WP plugins .
How to use
After activating the plugin, visit Downloads in the WP menu. There you can click “Add New” to add a download file. Here are the steps:
- 01Visit Add New
- 02Give the download a title
- 03Upload your image by clicking “Upload File”
- 04Optionally set the starting count and version
- 05Publish the post and done!
After adding a download, you can display a download link on the front end. Here are the steps:
- 06Visit Downloads to view a list of all downloads
- 07In the “Shortcode” column, click button to copy shortcode
- 08Visit any post or page and paste the shortcode
- 09Save changes and done!
Note: If you’re getting 404 errors when trying to download, here is a quick solution .
To display the count (number of downloads) on any post or page, follow these steps:
- 10Add the count shortcode [sdc_count id="123"] to your page
- 11Change the id attribute value to match your download ID
- 12Save changes and done!
Alternately you can display the download count (and other file information) next to the download link. To learn how, check out the next section on shortcodes.
Shortcodes
Description of all shortcodes..
Display download link: [sdc_download]
Attributes:
id (required) download ID wrap (optional) element to use for markup (p, div, span, none) text (optional) download link text title (optional) download link title before (optional) content to display before the download link after (optional) content to display after the download link class (optional) custom class for markup (separate multiple classes with commas) type (optional) display as "link", "button", or "none" (with none, only the before and after attributes are displayed, no link)
For example, a shortcode configuration that includes some possible attributes:
[sdc_download id="123" wrap="div" text="%title%" before="Download " after=" %size%"]
That will display a download link that says, “Download {download title} 64 KB”. And you can customize further with shortcut variables. Notice where it says %title% and %size% . Those are dynamic placeholders that output the download title and file size, respectively. You can use any of the following shortcuts for the text , title , before , and after attributes:
%id% displays download ID %count% displays download count %title% displays download title %version% displays download version %type% displays download type (local or remote) %ext% displays download file extenstion (e.g., JPG) %size% displays download file size
Using these shortcut variables, it’s possible to configure your download links however is desired.
Display download count: [sdc_count]
Attributes:
id (required) download ID wrap (optional) element to use for markup (p, div, span, none) before (optional) content to display before the download count after (optional) content to display after the download count class (optional) custom class for markup (separate multiple classes with commas)
For example, a shortcode configuration that includes some possible attributes:
[sdc_count id="123" wrap="div" before="Download count: " after=" - Version: %version%"]
That will display a line that says, “Download count: {download count} – Version: {download version}”. You can customize further with shortcut variables. Notice where it says %version% . That outputs the download version. You can use any of the following shortcuts for the before and after attributes:
%id% displays download ID %title% displays download title %version% displays download version %type% displays download type (local or remote) %ext% displays download file extenstion (e.g., JPG) %size% displays download file size
Using these shortcut variables, it’s possible to configure your download counts however is desired.
Display total download count: [sdc_count_total]
This shortcode displays the total number of times any/all published downloads have been downloaded.
[sdc_count_total]
No attributes for this one, just add to page and enjoy results.
Display the number of downloads: [sdc_downloads_published]
A simple shortcode to display the number of published downloads:
[sdc_downloads_published]
No attributes, just grab gulp and go.
Display download metadata: [sdc_meta]
Attributes:
id (required) download ID title (optional) download title url (optional) download URL count (optional) download count version (optional) download version type (optional) download type ext (optional) download file extension size (optional) download size
This shortcode displays any bit of meta information about the download. Here are some examples:
[sdc_meta id="123" size="true"] // displays the file size for download ID 123 [sdc_meta id="123" type="true"] // displays the file type for download ID 123 [sdc_meta id="1728" title="true" count="true"] // displays the title and count
By default, only the id is required. All other attributes are optional. Here is a blank template for quick copy/paste:
[sdc_meta id="" title="" url="" count="" version="" type="" ext="" size=""]
And here is another template with all available attributes set to true :
[sdc_meta id="123" title="true" url="true" count="true" version="true" type="true" ext="true" size="true"]
Remember to be mindful of the id attribute, make sure it is correct according to your downloads.
Display menu/list of download links [sdc_menu]
Attributes:
cat (required) category name/slug number (optional) number of download links included in a list extra (optional) show extra select menu for more downloads (true or false) text (optional) text for "Download more..." text in select menu
For example, a shortcode configuration that includes all possible attributes:
[sdc_menu cat="uncategorized" number="3" extra="true" text="Download more stuff.."]
That will display a list containing three download links. And also will display a dropdown/select menu with all other files available for download. This is a very flexible shortcode. Do experiment.
Display categories for any download [sdc_cats]
Attributes:
id (required) download ID links (optional) display category names as links to archives (true or false) format (optional) output format for category names (list, div, or span)
For example, a shortcode configuration that includes all possible attributes:
[sdc_cats id="123" links="true" format="list"]
That will display links for each category assigned to the download that has ID = 123. The links will be displayed using list markup. To display a simple comma separated list, use div or span for the format attribute.
Micro API
As of version 2.3, Simple Download Counter provides a “Micro API” for getting download counts via URL request. Learn all about it at Perishable Press .
Like the plugin?
If you like Simple Download Counter, please take a moment to give a 5-star rating . It helps to keep development and support going strong. Thank you!
Uninstalling
To uninstall/remove the plugin, visit the WP Plugins screen, deactivate and delete the plugin. When the plugin is deleted in this way, all plugin options are removed from the database automatically.
Note: Any defined downloads/files that may have been added will NOT be removed. Those are left in place in order for the site admin to decide whether or not to delete. Only the plugin options are removed when the plugin is uninstalled.
👉 Questions? Comments? Send ’em via the contact form at Plugin Planet.