[Plugin: WordPress Download Monitor] Add download template to single.php?
-
Each of my posts has a download id saved to the custom field
mp3_id
. For various reasons, using a shortcode to display the link and metadata for this download is impossible. I need to hook into the download information directly from my single.php template. How do I do this?This is the only code I found:
$dl = get_downloads('limit=5&orderby=hits&order=desc'); if (!empty($dl)) { echo '<ul>'; foreach($dl as $d) { echo '<li><a href="'.$d->url.'" title="Version '.$d->version.' downloaded '.$d->hits.' times" >'.$d->title.' ('.$d->hits.')</a></li>'; } echo '</ul>'; }
Since I’m not looking to create a loop of any kind, just access the information for a specific download from my single post template, this code is useless to me.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: WordPress Download Monitor] Add download template to single.php?’ is closed to new replies.