function group_query($args, &$gc) { $args['post_parent'] = get_the_ID(); $query = new WP_Query($args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); process_people_page_post(get_post(), $gc); group_query($args, $gc); } } }
<?php include 'research_functions.php'; get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <div id="people-header">I-STARs</div> <div class="istar-wrapper" id="people-wrapper"> <?php $args = array('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'ASC'); $groupcount = 0; group_query($args, $groupcount); ?> <script type="text/javascript"> $(".person-popup").hide(); $(".person-popup").prependTo("#page"); // immune to bad z-index effects </script> </div></div> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar(); get_footer();