--- a/taxonomy_menu.module +++ b/taxonomy_menu.module @@ -501,7 +501,7 @@ function _taxonomy_menu_save($item) { $insert = TRUE; $link = array(); } - + //create the path. //use url to create he inital path //we need to remove the first '/' so menu_link_save will work correctly @@ -790,7 +790,12 @@ function _taxonomy_menu_item($item) { //if tid is 0 then do not chagne any settings if ($item['tid'] > 0) { //get the number of node attached to this term - $num = _taxonomy_menu_term_count($item['tid']); + if (variable_get('taxonomy_menu_display_descendants_'. $item['vid'], FALSE)) { + $num = taxonomy_term_count_nodes($item['tid']); + } + else { + $num = _taxonomy_menu_term_count($item['tid']); + } //if hide menu is selected and the term count is 0 and the term has no children then do not create the menu item if ($num == 0 && @@ -803,10 +808,7 @@ function _taxonomy_menu_item($item) { //if display number is selected and $num > 0 then change the title if (variable_get('taxonomy_menu_display_num_'. $item['vid'], FALSE)) { - //if number > 0 and display decendants, then count all of the children - if (variable_get('taxonomy_menu_display_descendants_'. $item['vid'], FALSE)) { - $num = taxonomy_term_count_nodes($item['tid']); - } + $num = taxonomy_term_count_nodes($item['tid']); $item['name'] .= " ($num)"; } } elseif ($item['tid'] == 0) {