function ciGetAllStaff($maxNumEmployees = 100, $maxCharLength = -1) { $query = new WP_Query('showposts=' . $maxNumEmployees . '&post_type=' . CI_STAFF_TYPE); $employeeArray = array(); while ($query->have_posts()) { $query->next_post(); $attachment = wp_get_attachment_image_src(get_post_thumbnail_id($query->post->ID), CI_STAFF_IMG); $maybeExcerpt = has_excerpt($query->post->ID) ? $query->post->post_excerpt : $query->post->post_content; $employeeArray[] = array('id' => $query->post->ID, 'content' => ciFilterToMaxCharLength($maybeExcerpt, $maxCharLength), 'fullContent' => $query->post->post_content, 'title' => $query->post->post_title, 'imgURL' => $attachment ? $attachment[0] : '', 'imgWidth' => $attachment ? $attachment[1] : -1, 'imgHeight' => $attachment ? $attachment[2] : -1, 'url' => get_permalink($query->post->ID), 'socialURLs' => function_exists('ciGetStaffSocialURLs') ? ciGetStaffSocialURLs($query->post->ID) : array()); } wp_reset_postdata(); return $employeeArray; }
<?php while (have_posts()) { the_post(); ?> <?php the_content(); ?> <div> <?php if (function_exists('ciPrintSocialLinks')) { ciPrintSocialLinks(ciGetStaffSocialURLs(), 'alignright mb20'); } ?> </div> <?php wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); }