WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
How to use the download meta custom fields in the templates (2 posts)

  1. oliwa
    Member
    Posted 2 years ago #

    Hello, i have a template file and want to show some metainfo for the download. for example i can get title and link with

    echo '<h2><a href="'.$d->url.'">'.$d->title.'</a></h2>';

    but i cant get the custom field "slug" with

    echo '<p class="subhead">'.$d->meta-slug.'</p>'; or
    echo '<p class="subhead">'.$d->slug.'</p>';

    any ideas? thanks

    http://wordpress.org/extend/plugins/download-monitor/

  2. tomekmad
    Member
    Posted 2 years ago #

    replace
    $dl = get_downloads('limit=5&orderby=hits&order=desc');

    with

    $dl = $wpdb->get_results("SELECT * FROM prog_download_monitor_files files
    	INNER JOIN prog_download_monitor_file_meta meta
    	ON files.id=meta.download_id
    	WHERE meta.meta_name='YOUR-META-NAME'
    ");

    and then $d->meta_value

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic