I’m having a small issue with one of my queries here. I cannot increase my wordpress memory limit as long as hostgator sets it to 64mb. I’m not sure if its possible to reduce the amount of memory used making some changes to my code, here is the code I’m using to query users from a specific role and displaying their name, profile and avatar:
<?php $users = get_users('role=s2member_level3'); ?>
<?php foreach ($users as $user) {
$avatar = get_avatar($user->ID, '96');
if (get_the_author_meta('description', $user->ID) == "" && stristr($avatar,"gravatar.com/avatar")) { continue; }
?>
<div class="colaborador">
<div class="imagem-colaborador">
<?php if ($avatar == "") {
echo '<img src="https://1.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96" alt="Avatar" />';
} else {
echo $avatar;
} ?>
</div>
<div class="texto-colaborador">
<h2 class="nome-colaborador"><?php echo $user->display_name; ?></h2>
<p><?php the_author_meta('description', $user->ID); ?></p>
</div>
</div>
<?php } ?>