function um_members_directory_display($args)
{
    global $ultimatemember;
    extract($args);
    if (isset($args['search']) && $args['search'] == 1 && isset($args['must_search']) && $args['must_search'] == 1 && !isset($_REQUEST['um_search'])) {
        return;
    }
    if (um_members('no_users')) {
        ?>
		
		<div class="um-members-none">
			<p><?php 
        echo $args['no_users'];
        ?>
</p>
		</div>
			
		<?php 
    }
    $file = um_path . 'templates/members-grid.php';
    $theme_file = get_stylesheet_directory() . '/ultimate-member/templates/members-grid.php';
    if (file_exists($theme_file)) {
        $file = $theme_file;
    }
    if (um_members('users_per_page')) {
        include_once $file;
    }
}
function um_members_directory_display($args)
{
    global $ultimatemember;
    extract($args);
    if (isset($args['search']) && $args['search'] == 1 && isset($args['must_search']) && $args['must_search'] == 1 && !isset($_REQUEST['um_search'])) {
        return;
    }
    if (um_members('no_users')) {
        ?>
		
			<div class="um-members-none">
				<p><?php 
        echo $args['no_users'];
        ?>
</p>
			</div>
			
		<?php 
    }
    if (um_members('users_per_page')) {
        ?>
		
			<div class="um-members">
			
				<div class="um-gutter-sizer"></div>
				
				<?php 
        $i = 0;
        foreach (um_members('users_per_page') as $member) {
            $i++;
            um_fetch_user($member);
            ?>
			
				<div class="um-member <?php 
            echo um_user('account_status');
            ?>
 <?php 
            if ($cover_photos) {
                echo 'with-cover';
            }
            ?>
">
				
					<span class="um-member-status <?php 
            echo um_user('account_status');
            ?>
"><?php 
            echo um_user('account_status_name');
            ?>
</span>
					
					<?php 
            if ($cover_photos) {
                if ($ultimatemember->mobile->isTablet()) {
                    $cover_size = 600;
                } else {
                    $cover_size = 300;
                }
                ?>
					
					<div class="um-member-cover" data-ratio="<?php 
                echo um_get_option('profile_cover_ratio');
                ?>
">
						<div class="um-member-cover-e"><?php 
                echo um_user('cover_photo', $cover_size);
                ?>
</div>
					</div>
					
					<?php 
            }
            ?>
		
					<?php 
            if ($profile_photo) {
                $default_size = str_replace('px', '', um_get_option('profile_photosize'));
                $corner = um_get_option('profile_photocorner');
                ?>
					<div class="um-member-photo radius-<?php 
                echo $corner;
                ?>
"><a href="<?php 
                echo um_user_profile_url();
                ?>
" title="<?php 
                echo um_user('display_name');
                ?>
"><?php 
                echo get_avatar(um_user('ID'), $default_size);
                ?>
</a></div>
					<?php 
            }
            ?>
					
					<div class="um-member-card <?php 
            if (!$profile_photo) {
                echo 'no-photo';
            }
            ?>
">
						
						<?php 
            if ($show_name) {
                ?>
						<div class="um-member-name"><a href="<?php 
                echo um_user_profile_url();
                ?>
" title="<?php 
                echo um_user('display_name');
                ?>
"><?php 
                echo um_user('display_name', 'html');
                ?>
</a></div>
						<?php 
            }
            ?>
						
						<?php 
            do_action('um_members_just_after_name', um_user('ID'), $args);
            ?>
						
						<?php 
            do_action('um_members_after_user_name', um_user('ID'), $args);
            ?>
						
						<?php 
            if ($show_tagline && is_array($tagline_fields)) {
                foreach ($tagline_fields as $key) {
                    if ($key && um_filtered_value($key)) {
                        $value = um_filtered_value($key);
                        ?>
						
						<div class="um-member-tagline"><?php 
                        echo $value;
                        ?>
</div>
						
						<?php 
                    }
                }
            }
            ?>
						
						<?php 
            if ($show_userinfo) {
                ?>
						
						<div class="um-member-meta-main">
						
							<?php 
                if ($userinfo_animate) {
                    ?>
							<div class="um-member-more"><a href="#"><i class="um-faicon-angle-down"></i></a></div>
							<?php 
                }
                ?>
							
							<div class="um-member-meta <?php 
                if (!$userinfo_animate) {
                    echo 'no-animate';
                }
                ?>
">
							
								<?php 
                foreach ($reveal_fields as $key) {
                    if ($key && um_filtered_value($key)) {
                        $value = um_filtered_value($key);
                        ?>
								
								<div class="um-member-metaline um-member-metaline-<?php 
                        echo $key;
                        ?>
"><span><strong><?php 
                        echo $ultimatemember->fields->get_label($key);
                        ?>
:</strong> <?php 
                        echo $value;
                        ?>
</span></div>
								
								<?php 
                    }
                }
                ?>
								
								<?php 
                if ($show_social) {
                    ?>
								<div class="um-member-connect">
								
									<?php 
                    $ultimatemember->fields->show_social_urls();
                    ?>

								</div>
								<?php 
                }
                ?>
								
							</div>

							<div class="um-member-less"><a href="#"><i class="um-faicon-angle-up"></i></a></div>
						
						</div>
						
						<?php 
            }
            ?>
						
					</div>
					
				</div>
				
				<?php 
            um_reset_user_clean();
        }
        // end foreach
        um_reset_user();
        ?>
				
				<div class="um-clear"></div>
				
			</div>
			
		<?php 
    }
}
<div class="um-members">
			
	<div class="um-gutter-sizer"></div>
	
	<?php 
$i = 0;
foreach (um_members('users_per_page') as $member) {
    $i++;
    um_fetch_user($member);
    ?>
			
	<div class="um-member um-role-<?php 
    echo um_user('role');
    ?>
 <?php 
    echo um_user('account_status');
    ?>
 <?php 
    if ($cover_photos) {
        echo 'with-cover';
    }
    ?>
">
				
		<span class="um-member-status <?php 
    echo um_user('account_status');
    ?>
"><?php 
    echo um_user('account_status_name');
    ?>
</span>