Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $employeeQuery = new WP_Query(array('post_type' => 'professionals', 'meta_key' => 'prof_lastname', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => '-1')); ?>
- <?php $prevltr = ""; ?>
- <?php if(have_posts()) { while ( $employeeQuery->have_posts() ) { $employeeQuery->the_post(); ?>
- <?php $lastname = get_post_meta($post->ID, 'prof_lastname', true); ?>
- <?php $curltr = substr($lastname,0,1); ?>
- <?php if($curltr != $prevltr) : ?>
- <a name="section-<?php echo $curltr ?>"></a><br class="clear" /><h2><?php echo $curltr; $prevltr = $curltr; ?></h2>
- <?php endif; ?>
- <article class="professional-entry" id="entry-<?php echo $last_char ?>">
- <div><strong><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></strong></div>
- <div><?php $terms = get_the_terms( $post->ID , 'titles' ); foreach( $terms as $term ) { print $term->name; unset($term); } ?></div>
- <div><a href="mailto:<?php echo get_post_meta($post->ID, 'prof_email', true); ?>"><?php echo get_post_meta($post->ID, 'prof_email', true); ?></a></div>
- </article>
- <?php }} // End the loop. Whew. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement