Not an ideal solution. If I’m understanding you correctly, you’re saying whenever a document is in a sub-category, you ALSO need to select the parent category to have the correct count on the ‘archive’ page.
In general, parent categories don’t have documents in them by themselves. They are a summing category.
From a programming perspective, it would make more sense that when something is a sub-category, the count loop for the parent category isn’t the total.
Here’s what I recommend (and ultimately what I changed in the code to make it work as it should). On wpdm-archive-page.php starting from line 126 change it to the following:
<?php if($parent == $base && count($cld) > 0): /*there are subcategories*/ ?>
<?php /*get total parent count*/
$q = new WP_Query( array(
'nopaging' ► true,
'tax_query' ► array(
array(
'taxonomy' ► $category->taxonomy,
'field' ► 'id',
'terms' ► $category->term_id,
'include_children' ► true,
),
),
'fields' ► 'ids',
));
$ccount = $q->post_count;
?>
Hope this helps – and that you ultimately change this, so that I don’t have to modify the file myself everytime there is an update.