Shortcodes

[wpdm_download_count] Shortcode

2 min read Updated Jun 4, 2026

Overview

The [wpdm_download_count] shortcode displays total downloads across all packages. Useful for displaying social proof and engagement metrics.

Prerequisites

  • WordPress Download Manager installed
  • Download tracking enabled
  • Packages with recorded downloads

Syntax

Total downloads site-wide:

[wpdm_download_count]

Common Use Cases

  • Homepage Stats
  • Display impressive download numbers:
  • Sidebar Widget
  • Download Stats
  • Site statistics in footer:
    • 📥 [wpdm_download_count] Downloads
    • 📦 [wpdm_package_count] Packages

Related Shortcode

[wpdm_package_count]

Count total packages:

[wpdm_package_count]

Data Source

The download count comes from:

  • __wpdm_download_count post meta for packages
  • wp_ahm_download_stats table for detailed tracking

Styling

CSS for Count Display

/* Basic counter */
.wpdm-download-count {
    font-weight: 700;
    color: #4f46e5;
}

/* Large display */
.download-stat {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* With icon */
.download-counter::before {
    content: "📥 ";
}

/* Card style */
.stat-card {
    display: inline-block;
    padding: 24px 32px;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
}

.stat-card .number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .label {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

Animated Counter Effect

0


document.querySelectorAll('.animated-counter').forEach(counter => {
    const target = parseInt(counter.dataset.target);
    const duration = 2000;
    const step = target / (duration / 16);
    let current = 0;

    const timer = setInterval(() => {
        current += step;
        if (current >= target) {
            counter.textContent = target.toLocaleString();
            clearInterval(timer);
        } else {
            counter.textContent = Math.floor(current).toLocaleString();
        }
    }, 16);
});

Multiple Stats Dashboard

Create a statistics dashboard:

📥  [wpdm_download_count]  – Total Downloads
📦  [wpdm_package_count] – Packages

CSS:

.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 40px;
}

.stat-box {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

Troubleshooting

Shows Zero

Causes:

  • No downloads recorded

Solutions:

  • Verify downloads are tracked
  • Check ID/slug is correct
  • Enable download tracking in settings

Count Seems Wrong

Cause: Cache or meta sync issue

Solution:

  • Clear caching
  • Recalculate counts in settings
  • Check download statistics page

Not Displaying

Cause: Shortcode not registered

Solution:

  • Verify WPDM is active
  • Check for plugin conflicts

Related Documentation


Applies to: WordPress Download Manager 7.x