added another level of sub categories in dropdown
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 2 Feb 2016 15:35:41 +0000 (10:35 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 2 Feb 2016 15:35:41 +0000 (10:35 -0500)
index.php

index bb63332..59f59a8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -528,11 +528,19 @@ function michsci_get_terms_dropdown($cat_id)
                 }
                 $output .= '>' . "&nbsp&nbsp&nbsp" .  $child->name . '</option>';
                 foreach($grandchildren as $gchild){
+                    $ggrandchildren = get_terms($taxonomyName, array('parent'=> $gchild->term_id, 'child_of' => $gchild->term_id, 'orderby' => 'name', 'hide_empty' => false));
                  $output .= '<option value="' . $gchild->term_id . '"';
                     if ($_REQUEST[MICHSCI_CATEGORY_NAME] == $gchild->term_id) {
                         $output .= ' selected';
                     }
                     $output .= '>' . "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" .  $gchild->name . '</option>';
+                    foreach($ggrandchildren as $ggchild){
+                         $output .= '<option value="' . $ggchild->term_id . '"';
+                    if ($_REQUEST[MICHSCI_CATEGORY_NAME] == $ggchild->term_id) {
+                        $output .= ' selected';
+                    }
+                    $output .= '>' . "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" .  $ggchild->name . '</option>';
+                    }
                 }
         }
     }