<i class="fa fa-book"></i><?php echo $menu_page->label; ?> </a> <?php /* Get the name of the current menu page */ $menu_page_name = $menu_page->rewrite['slug']; /* If the menu page name is the same as the current division, do stuff */ if ($menu_page_name == $page_div) { /* Replace hypens with underscores to get taxonomy type */ $cat_type = $menu_page_type; /* Append _tax to create taxonomy name */ $cat_name = $cat_type . '_tax'; /* Get category pages */ $cat_pages = getDivisionCategories($cat_type, $cat_name); /* If the categories query is not empty, do stuff */ if (!empty($cat_pages)) { ?> <ul class="site-navigation_categories"> <?php /* For each category, do stuff */ foreach ($cat_pages as $cat_page) { $cat_term_link = get_term_link($cat_page); // Get category page link ?> <li class="side-nav_item side-nav_item-second"> <a href="<?php
// Get the name $div_type = $div_obj->name; // Get the type $div_slug = $div_obj->rewrite['slug']; // Get the slug ?> <h1 class="entry-title"><?php echo $div_label; ?> </h1> <?php $div_tax = $div_type . "_tax"; // Get the taxonomy $cats = getDivisionCategories($div_type, $div_tax); // Query the categories for this division /* Loop through each category */ foreach ($cats as $cat) { $cat_archive = get_term_link($cat); // Get link to term page ?> <div class="card-container grid-33 tablet-grid-50 mobile-grid-100"> <div class="card card-stack card-category"> <a class="card_link" href="<?php echo $cat_archive; ?> "> <div class="card_top card_top-<?php echo $div_slug;