Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $linkCats = get_terms('link_category');
- $i = 1;
- $catsToList;
- foreach ($linkCats as $linkCat) {
- if ($linkCat->parent == 5) {
- if ($i > 1) {
- $catsToList .= ", ";
- }
- $catsToList .= $linkCat->term_id;
- $i++;
- }
- }
- $topLevelCatList = array(
- 'category' => 5,
- );
- wp_list_bookmarks($topLevelCatList);
- if ($catsToList) {
- $subCats = array(
- 'category' => $catsToList,
- );
- wp_list_bookmarks($subCats);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement