bwade231

Team details page

Sep 22nd, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?php
  2.  
  3. /* Template Name: Team */
  4.  
  5. get_header(); ?>
  6.  
  7. <div id="content" class="narrowcolumn" role="main">
  8.  
  9. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  10. <div class="post" id="post-<?php the_ID(); ?>">
  11. <h2><?php the_title(); ?></h2>
  12. <div class="entry">
  13.  
  14. <?php the_content(); ?>
  15.  
  16. <h2>Our Team</h2>
  17.  
  18. <?php
  19. $team = new Pod('team');
  20. $team->findRecords('name ASC');
  21. $total_members = $team->getTotalRows();
  22. ?>
  23.  
  24. <?php if( $total_members>0 ) : ?>
  25. <?php while ( $team->fetchRecord() ) : ?>
  26.  
  27. <?php
  28. // set our variables
  29. $member_id = $team->get_field('id');
  30. $member_name = $team->get_field('name');
  31. $member_position = $team->get_field('position');
  32. $member_photo = $team->get_field('photo');
  33. $member_bio = $team->get_field('bio');
  34. $member_eom = $team->get_field('eom');
  35.  
  36. // data cleanup
  37. $member_bio = wpautop( $member_bio );
  38. $member_photo = $member_photo[0]['guid'];
  39. ?>
  40.  
  41. <div class="member" id="member<?php echo $member_id; ?>">
  42. <h3><?php echo $member_name; ?></h3>
  43. <h4><?php echo $member_position; ?></h4>
  44. <?php if( !empty( $member_photo ) ) : ?>
  45. <img src="<?php echo $member_photo; ?>" alt="Photo of <?php echo $member_name; ?>" />
  46. <?php endif ?>
  47. <?php echo $member_bio; ?>
  48. </div>
  49. <!-- /member -->
  50.  
  51. <?php endwhile ?>
  52. <?php endif ?>
  53.  
  54. </div>
  55. </div>
  56. <?php endwhile; endif; ?>
  57.  
  58. </div>
  59.  
  60. <?php get_sidebar(); ?>
  61.  
  62. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment