1.     $posts_query = new WP_Query($post_args);
  2.     $total_items = $posts_query->post_count; // total profiles
  3.     if ($posts_query->have_posts() ) {
  4.         echo '<div id="galleries-list">';
  5.         echo '<ul class="block-grid '.$number_columns.'-up">';
  6.         while ($posts_query->have_posts()) {
  7.             $posts_query->the_post();
  8.             galleries_list();
  9.         }
  10.         echo '</ul>';
  11.         echo '</div>';
  12.     } // done our wordpress loop. Will start again for each category
  13.     wp_reset_postdata(); // reset the query