Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * This is how to access and build a nested areas of practice list.
- */
- $areas_of_practice = ssc_get_areas_list();
- foreach($areas_of_practice as $parent_area => $child_areas) {
- echo '<ul class="top-level"><li>';
- echo '<a href = "' . get_permalink($parent_area) . '">';
- // if thumbnail is needed for this list
- echo get_the_thumbnail($parent_area);
- echo get_the_title($parent_area);
- echo '</a>';
- if (is_array($child_areas)) {
- echo '<ul class="second-level">';
- foreach ($child_areas as $child_area) {
- echo '<li><a href="' . get_the_permalink($child_area) . '">' . get_the_title($child_area) . '</a></li>';
- }
- echo '</ul>';
- }
- echo '</li>';
- }
- echo '</ul>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement