Hello Zibi,
It doesn’t work because the shortcode does not allow you to pass post_id as an argument. It would be required here.
But there’s a much better and flexible method for this case, just use the da_display_download_attachments() function:
$query_brands = new WP_Query('post_type=brand');
// optional arguments
$args = array(
'container' => 'div',
'container_class' => 'download-attachments',
'container_id' => '',
'style' => 'list',
'link_before' => '',
'link_after' => '',
'display_user' => true,
'display_icon' => true,
'display_count' => true,
'display_size' => true,
'display_date' => true,
'display_caption' => true,
'display_description' => true,
'display_empty' => 0,
'display_option_none' => __('No attachments to download', 'download-attachments'),
'use_desc_for_title' => 0,
'exclude' => '',
'include' => '',
'title' => __('Download Attachments', 'download-attachments'),
'orderby' => 'menu_order',
'order' => 'asc',
'echo' => 1 // 1 for echo or 0 for return
);
while ($query_brands->have_posts()) : $query_brands->the_post();
the_title();
// echo the attachments
da_display_download_attachments($post->ID, $args);
endwhile;
Of course you don’t have to use the $args and rely on what you have set in the plugin settings. Then use:
da_display_download_attachments($post->ID);