public static function group($id, $attributes = array())
 {
     $groups = $options = array();
     query_posts(array('post_type' => 'group', 'posts_per_page' => -1));
     while (have_posts()) {
         the_post();
         $groups[get_the_ID()] = sp_get_group();
     }
     wp_reset_query();
     usort($groups, 'group_name_sort');
     foreach ($groups as $group) {
         $options[$group->id] = $group->name;
     }
     return array('name' => __('Group/Unit', 'scoutwp_plugin'), 'desc' => __('Group or Unit this section belongs to.', 'scoutwp_plugin'), 'id' => $id . '_group', 'type' => 'select', 'options' => $options, 'attributes' => $attributes);
 }
 *
 * If you'd like to further customize these archive views, you may create a
 * new template file for each one. For example, tag.php (Tag archives),
 * category.php (Category archives), author.php (Author archives), etc.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Fifteen
 * @since Twenty Fifteen 1.0
 */
get_header();
?>

		<?php 
$group = sp_get_group();
if ($group->email) {
    $contact = sp_get_contact('group', $group);
    $contact->send_email();
}
?>
		<article id="sp-group-sections-<?php 
echo $group->id;
?>
" class="sp-group-sections sp-group-<?php 
echo $group->id;
?>
">
		<?php 
if (have_posts()) {
    ?>
 *
 * If you'd like to further customize these archive views, you may create a
 * new template file for each one. For example, tag.php (Tag archives),
 * category.php (Category archives), author.php (Author archives), etc.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Fifteen
 * @since Twenty Fifteen 1.0
 */
get_header();
$groups = array();
while (have_posts()) {
    the_post();
    $groups[get_the_ID()] = sp_get_group();
}
$groups = sp_get_group_sections($groups);
?>
	<article id="sp-groups-list" class="sp-group-list">
		<header class="page-header">
			<h1><?php 
_e('Groups and Units');
?>
</h1>
			<div class="find-group-buttons">
				<?php 
echo sp_find_group() . sp_scroll_to_map();
?>
			</div>
		</header>