+
> +
+ ', '' ); ?> +
+
+ +
+ -1, + 'post_type' => 'person', + 'orderby' => 'menu_order title', + 'order' => 'ASC', + ); + + + + // Settings + + $layout = get_field( "layout" ); + $people_to_display = get_field( "people_to_display" ); + $break_into_groups = get_field( "break_into_groups" ); + $specific_people = get_field( "specific_people" ); + $specific_groups = get_field( "specific_groups" ); + $specific_tags = get_field( "specific_tags" ); + $information_to_display = get_field( "information_to_display" ); + + var_dump($specific_people); + + + + if ($specific_people){ + global $specific_people; + global $args; + $post__in = array(); + foreach($specific_people as &$value){ + array_push($post__in, $value->ID); + } + $args[post__in]= $post__in; + } + + // do we need a tax query? + if ($specific_groups != false || $specific_tags != false){ + + $tax_query = array(); + + if ($specific_groups != false) { + $group_query = array( + 'taxonomy' => 'group', + 'field' => 'term_id', + 'terms' => $specific_groups + ); + array_push($tax_query, $group_query); + } + if ($specific_tags != false) { + $tag_query = array( + 'taxonomy' => 'persontag', + 'field' => 'term_id', + 'terms' => $specific_tags + ); + array_push($tax_query, $tag_query); + } + $args[tax_query] = $tax_query; + + } + if ($break_into_groups == 1 ){ + echo '

Break into Groups

'; + + // get all the people + $the_query = new WP_Query( $args ); + + print_r($the_query->posts); + echo '
'; + // focusing on jus the people, not the rest of the query. + $people = $the_query->posts; + // look at each person, and see each group used. + foreach($people as $value){ + $id = $value->ID; + echo '
'; + $terms = get_the_terms($id, 'group'); + var_dump($terms); + } + /**/ + + echo '
'; + + var_dump($the_query); + /* + if ( $the_query->have_posts() ) { + while ( $the_query->have_posts() ) { + //$the_query->posts; + //the_title(); + } + }; + + */ + + // get all the people (after they've beeen filtered down) + + // check those people for groups (don;t want to be listing groups we won;t use) + + // Create a list for each group. + + // display all people that belong to that group. + + } + /* + if ($layout == 'grid') { + include('inc/people-grid.php'); + } + if ($layout == 'list') { + include('inc/people-list.php'); + } + if ($layout == 'table') { + include('inc/people-table.php'); + } + */ + + + ?> +
+ +
+
+
+ ', '' ); ?> +
+
+