Advertisement
Guest User

Use the transient

a guest
Jul 1st, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.  * This is how to access and build a nested areas of practice list.
  4.  */
  5.  $areas_of_practice = ssc_get_areas_list();
  6.  
  7.  foreach($areas_of_practice as $parent_area => $child_areas) {
  8.   echo '<ul class="top-level"><li>';
  9.   echo '<a href = "' . get_permalink($parent_area) . '">';
  10.   // if thumbnail is needed for this list
  11.   echo get_the_thumbnail($parent_area);
  12.   echo get_the_title($parent_area);
  13.   echo '</a>';
  14.   if (is_array($child_areas)) {
  15.     echo '<ul class="second-level">';
  16.     foreach ($child_areas as $child_area) {
  17.       echo '<li><a href="' . get_the_permalink($child_area) . '">' . get_the_title($child_area) . '</a></li>';
  18.       }
  19.     echo '</ul>';
  20.   }
  21.   echo '</li>';
  22.  
  23.    
  24.  
  25.  }
  26.  echo '</ul>';
  27.  ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement