Yeah, multiple thoughts :)
But lets start with this one: there’s a da_display_attachments filter hook that allows you to modify the display of attachments metabox based on any condition. For example:
function custom_da_display_attachments($html) {
if (in_category(1)) { // if current post belongs to category of id 1
$html = ''; // do not display the attachments metabox
}
return $html;
}
add_filter('da_display_attachments', 'custom_da_display_attachments');
But I’m not sure it will work for you.
So let’s try being a bit more creative. Set your attachments display from before/after the content to manual and let this code handle the display instead:
function custom_the_content($content) {
if(!has_shortcode($content, 'download-attachments')) {
// The content doesn't include the [download-attachments] shortcode so display the attachments now
$content = $content . do_shortcode('[download-attachments]');
}
return $content;
}
add_filter('the_content', 'custom_the_content');
It check’s if you used the shotcode it the post content. If you did it does nothing, if you didn’t it will append attachments right after the content.